> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/api-reference/invitations.md).

# Invitations

## Accept Invitation

> Accept a pending invitation, resolving it to an active membership and optionally setting a first password.\
> \
> Setting a first password makes the account usable for the first time, so it\
> is reported to \`\`GrowthSignalPort\`\` as a signup.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"paths":{"/api/v1/invitations/accept":{"post":{"description":"Accept a pending invitation, resolving it to an active membership and optionally setting a first password.\n\nSetting a first password makes the account usable for the first time, so it\nis reported to ``GrowthSignalPort`` as a signup.","operationId":"invitations-accept_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationResultPublic"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Accept Invitation","tags":["invitations"]}}},"components":{"schemas":{"AcceptInvitationRequest":{"properties":{"full_name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"description":"Filled in only if not already set.","title":"Full Name"},"password":{"anyOf":[{"maxLength":1024,"type":"string"},{"type":"null"}],"description":"Sets the invited identity's password in the same step, when the preview reported needs_password. Needs no mail: the link is the proof, whether it was emailed or an admin handed it over.","title":"Password"},"terms_accepted":{"default":false,"description":"Whether the caller accepted this deployment's terms.","title":"Terms Accepted","type":"boolean"},"token":{"title":"Token","type":"string"}},"required":["token"],"title":"AcceptInvitationRequest","type":"object"},"AcceptInvitationResultPublic":{"description":"What accepting produces: enough for the accept page to say where the visitor landed.\n\nNo session and no token. When the request carried a password, the identity\ncan sign in straight away; otherwise it stays password-less until claimed by\nsignup or a provider sign-in.","properties":{"can_sign_in":{"default":true,"description":"Whether the invited address can sign in now, with a password (this accept's included) or through a provider. False when it accepted without one and has never signed in.","title":"Can Sign In","type":"boolean"},"organization_name":{"title":"Organization Name","type":"string"},"password_set":{"default":false,"description":"Whether this accept set the identity's password.","title":"Password Set","type":"boolean"},"role":{"title":"Role","type":"string"},"verification_pending":{"default":false,"description":"Whether the invited address chose a password through signup and has not verified it yet, so it has to open its verification link before it can sign in.","title":"Verification Pending","type":"boolean"},"ways_in":{"description":"When can_sign_in is false, what this deployment offers instead, as the preview's ways_in says.","items":{"enum":["provider","password_reset"],"type":"string"},"title":"Ways In","type":"array"}},"required":["organization_name","role"],"title":"AcceptInvitationResultPublic","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}}}
```

## Validate Invitation

> Look up a pending invitation by its token, for the accept page to render before committing.\
> \
> A \`\`POST\`\` with the token in the body, not a \`\`GET\`\` with it in the URL:\
> the token is a bearer credential, and a URL path is what an access log or\
> an intermediate proxy routinely retains.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"paths":{"/api/v1/invitations/validate":{"post":{"description":"Look up a pending invitation by its token, for the accept page to render before committing.\n\nA ``POST`` with the token in the body, not a ``GET`` with it in the URL:\nthe token is a bearer credential, and a URL path is what an access log or\nan intermediate proxy routinely retains.","operationId":"invitations-validate_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateInvitationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreviewPublic"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Validate Invitation","tags":["invitations"]}}},"components":{"schemas":{"ValidateInvitationRequest":{"description":"The preview lookup's body.\n\nA ``POST`` with the token in the body rather than a ``GET`` with it in the\nURL, matching ``AcceptInvitationRequest``: the token is a bearer-style\ncredential (see ``Invitation.token_hash``'s docstring), and a URL is one a\nproxy or an access log routinely retains, which a request body is not.","properties":{"token":{"title":"Token","type":"string"}},"required":["token"],"title":"ValidateInvitationRequest","type":"object"},"InvitationPreviewPublic":{"description":"What an unauthenticated visitor sees before committing to accept.\n\nDeliberately narrow: the address it was sent to, the organization's name,\nand the role on offer. The token is the caller's only credential here, not\na session, so this carries nothing that identifies who sent it or any\nother member.","properties":{"can_sign_in":{"description":"Whether the invited address can already sign in, with a password or through a provider.","title":"Can Sign In","type":"boolean"},"email":{"title":"Email","type":"string"},"expires_at":{"format":"date-time","title":"Expires At","type":"string"},"needs_password":{"description":"Whether accepting should also set the invited address's first password. False when the address already has a way in, and also when another organization has it as a member or invitee, since this link may not choose a password for it then; can_sign_in tells the two apart. Accept refuses a password whenever this is false.","title":"Needs Password","type":"boolean"},"organization_name":{"title":"Organization Name","type":"string"},"role":{"title":"Role","type":"string"},"ways_in":{"description":"When the address cannot sign in yet and this link will not set its password, what this deployment offers instead once it has accepted: 'provider' (sign in with Google or GitHub) and 'password_reset' (choose a password with \"Forgot your password?\"). Empty otherwise, and empty when the deployment offers neither, in which case whoever administers it has to help.","items":{"enum":["provider","password_reset"],"type":"string"},"title":"Ways In","type":"array"}},"required":["email","organization_name","role","expires_at","needs_password","can_sign_in","ways_in"],"title":"InvitationPreviewPublic","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/api-reference/invitations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
