Docs
Search docs

Preview an invite by its bearer token

GET/api/invites/{token}

previewInvite

Anyone with the token can read it (the SPA renders the accept page from this). `target` says what accepting grants: membership of an org (`kind: org`) or a role on one repository (`kind: repo`). Returns 404 if the token doesn't match an invite, or 409 `already_exists` if the token is real but no longer usable (accepted, revoked, or expired) — the same status `acceptInvite` returns for that condition.

Authentication is not described for this operation in the spec — that does not mean it is public. Check tokens and scopes.

curl

curl -X GET 'https://neosource.dev/api/invites/TOKEN'

fetch

fetch("https://neosource.dev/api/invites/TOKEN", {
  method: "GET",
});

Path parameters

tokenrequired

string

Responses

200Invite

application/json

InvitePreviewResponse

object

emailrequired

string

expires_atrequired

integerint64

org_display_name

string | nulldeprecated

`target.org_display_name`, flat, for an org invite only (see `org_slug`).

org_slug

string | nulldeprecated

`target.org_slug`, flat, for an org invite only: the accept page of a SPA bundle built before `target` existed reads these three fields, and the web and api images deploy separately.

role
one of
  • WorkspaceRole

    string

    Workspace membership role. Ordered low → high (`Member < Admin < Owner`) so that `if actor_role >= WorkspaceRole::Admin` reads naturally.

    "member""admin""owner"

  • null

targetrequired

InviteTarget

What an invite grants on accept.

one of
  • object

    Membership of an organization. Slug + display name suffice for the SPA to render "X invited you to join Y" without the `invite_id`.

    kindrequired

    string

    "org"

    org_display_namerequired

    string

    org_slugrequired

    string

    rolerequired
    WorkspaceRole
  • object

    A grant on one repository.

    kindrequired

    string

    "repo"

    ownerrequired

    string

    reporequired

    string

    rolerequired
    RepoRole

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 404Not Found — one of: not_found
  • 409Conflict — one of: already_exists
  • 429Rate limited — retry after the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget

Schemas

Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.

WorkspaceRole

string

Workspace membership role. Ordered low → high (`Member < Admin < Owner`) so that `if actor_role >= WorkspaceRole::Admin` reads naturally.

"member""admin""owner"

RepoRole

string

Repo-level role (read/write/maintain/admin). Ordered low → high so `if role >= RepoRole::Write` reads naturally.

"read""write""maintain""admin"