> For the complete documentation index, see [llms.txt](https://docs.zenlytic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zenlytic.com/developers/api-reference/workspace-administration/invites/create-invite.md).

# Create Invite

Invite a new member to the workspace by email.

Reuses the same invite creation and email-send flow as the in-product "Invite" action. `role` is optional and defaults to the workspace's configured default role.

Returns 409 if the email is already a member of the workspace or already has a pending invite.

Returns 403 if `role` is `organization_admin` and the caller doesn't already hold organization-admin access on this workspace - only an existing organization admin can invite another one. On a free-tier workspace, `role` must be `admin`; any other role returns 400.

Returns 403 if the workspace is on a self-service plan and this invite would exceed its seat limit, its billing subscription isn't set up yet, or its subscription status doesn't currently allow billing changes (e.g. past due).

Returns 400 if the workspace's SSO provider restricts allowed email domains and `email`'s domain isn't one of them.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"2.0.0"},"tags":[{"name":"Invites"}],"servers":[{"url":"https://api-external.zenlytic.com/api/v2","description":"US"},{"url":"https://euapi-external.zenlytic.com/api/v2","description":"EU"}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","description":"A Personal Access Token (PAT).","scheme":"bearer"}},"schemas":{"CreateInviteSchema":{"properties":{"email":{"type":"string","title":"Email"},"role":{"anyOf":[{"type":"string","enum":["organization_admin","admin","develop","develop_without_deploy","explore","view","restricted","embed","embedded_with_scheduling","embed_with_sql"]},{"type":"null"}],"title":"Role","description":"The role to grant once the invite is accepted; defaults to the workspace's configured default role if omitted."}},"type":"object","required":["email"],"title":"CreateInviteSchema"},"ApiV2Response_InviteSchema_":{"properties":{"data":{"$ref":"#/components/schemas/InviteSchema"},"meta":{"$ref":"#/components/schemas/MetaSchema"}},"type":"object","required":["data","meta"],"title":"ApiV2Response[InviteSchema]"},"InviteSchema":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","enum":["organization_admin","admin","develop","develop_without_deploy","explore","view","restricted","embed","embedded_with_scheduling","embed_with_sql"],"title":"Role","description":"The role this invite will grant once accepted."},"invite_url":{"type":"string","title":"Invite Url","description":"The signup link for the invitee to accept this invite; the same link sent in the invite email."},"created_date":{"type":"string","format":"date-time","title":"Created Date"}},"type":"object","required":["id","workspace_id","email","role","invite_url","created_date"],"title":"InviteSchema"},"MetaSchema":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"errors":{"items":{"$ref":"#/components/schemas/ErrorSchema"},"type":"array","title":"Errors","description":"Non-empty exactly when `status` is \"error\"."},"warnings":{"items":{"$ref":"#/components/schemas/WarningSchema"},"type":"array","title":"Warnings","description":"Can be non-empty even when `status` is \"success\" - a non-fatal issue with an otherwise-successful request."}},"type":"object","required":["status"],"title":"MetaSchema"},"ResponseStatus":{"type":"string","enum":["success","error"],"title":"ResponseStatus"},"ErrorSchema":{"properties":{"message":{"type":"string","title":"Message"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code","description":"Matches this response's actual HTTP status code."},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurred At","description":"ISO 8601 UTC timestamp."},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Machine-readable code for errors that need special handling (e.g. \"SSO_REQUIRED\") rather than being shown generically; null for most errors."},"error_metadata":{"anyOf":[{"$ref":"#/components/schemas/BaseErrorMetadata"},{"type":"null"}],"description":"Additional structured detail for specific error conditions; usually null."}},"type":"object","required":["message"],"title":"ErrorSchema"},"BaseErrorMetadata":{"properties":{},"type":"object","title":"BaseErrorMetadata"},"WarningSchema":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"WarningSchema"},"ApiV2ErrorResponse":{"properties":{"meta":{"$ref":"#/components/schemas/MetaSchema"}},"type":"object","required":["meta"],"title":"ApiV2ErrorResponse"}}},"paths":{"/workspaces/{workspace_id}/invites":{"post":{"tags":["Invites"],"summary":"Create Invite","description":"Invite a new member to the workspace by email.\n\nReuses the same invite creation and email-send flow as the in-product \"Invite\" action.\n``role`` is optional and defaults to the workspace's configured default role.\n\nReturns 409 if the email is already a member of the workspace or already has a pending invite.\n\nReturns 403 if ``role`` is ``organization_admin`` and the caller doesn't already hold\norganization-admin access on this workspace - only an existing organization admin can invite\nanother one. On a free-tier workspace, ``role`` must be ``admin``; any other role returns 400.\n\nReturns 403 if the workspace is on a self-service plan and this invite would exceed its\nseat limit, its billing subscription isn't set up yet, or its subscription status doesn't\ncurrently allow billing changes (e.g. past due).\n\nReturns 400 if the workspace's SSO provider restricts allowed email domains and ``email``'s\ndomain isn't one of them.","operationId":"create_invite_workspaces__workspace_id__invites_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteSchema"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiV2Response_InviteSchema_"}}}},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiV2ErrorResponse"}}},"description":"Client Error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiV2ErrorResponse"}}},"description":"Server Error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zenlytic.com/developers/api-reference/workspace-administration/invites/create-invite.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
