Skip to content

List invitations

GET/v1/practices/{practiceId}/team/invitations

Requires team:read. Lists practice invitations, including invitations sent in Clinic. Filter by pending, expired, accepted, declined, or revoked status, exact email, or your integration externalId. Only your integration and API key mode can see its external identity and onboarding state. Follow person.nextActions after invitation acceptance.

Request example

curl -X GET 'https://api.affinityrx.com/v1/practices/{practiceId}/team/invitations' \
  -H "Authorization: Bearer $AFFINITY_API_KEY" \
  -H 'Affinity-Version: 2026-09-28'

Response example

These examples show the body structure. Values can differ. Select a status code to see its response.

{
  "data": [
    {
      "id": "invite_01j2y8m6jcc9tt24af5pw9x1bc",
      "object": "team_invitation",
      "email": "<string>",
      "name": "<string>",
      "status": "accepted",
      "roles": [
        {
          "id": "role_01j2y8m6jcc9tt24af5pw9x1bc",
          "name": "<string>",
          "key": "<string>"
        }
      ],
      "locationIds": [
        "loc_01j2y8m6jcc9tt24af5pw9x1bc"
      ],
      "createdAt": "<string>",
      "expiresAt": "<string>",
      "acceptedAt": "<string>",
      "userId": "user_01j2y8m6jcc9tt24af5pw9x1bc",
      "externalId": "<string>",
      "memberId": "mbr_01j2y8m6jcc9tt24af5pw9x1bc",
      "prescriberId": "prov_01j2y8m6jcc9tt24af5pw9x1bc",
      "person": {
        "id": "user_01j2y8m6jcc9tt24af5pw9x1bc",
        "object": "team_person",
        "externalId": "<string>",
        "email": "<string>",
        "name": "<string>",
        "status": "<string>",
        "invitation": {
          "id": "invite_01j2y8m6jcc9tt24af5pw9x1bc",
          "status": "accepted",
          "expiresAt": "<string>",
          "roles": [
            {
              "id": null,
              "name": null,
              "key": null
            }
          ]
        },
        "account": {
          "accountId": "<string>",
          "emailVerified": false,
          "membershipId": "mbr_01j2y8m6jcc9tt24af5pw9x1bc",
          "membershipStatus": "<string>",
          "roles": [
            {
              "id": null,
              "name": null,
              "key": null
            }
          ],
          "prescriberConnection": {
            "status": null,
            "provider": null
          }
        },
        "nextActions": [
          "<string>"
        ]
      }
    }
  ],
  "hasMore": false,
  "object": "list",
  "url": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 400,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 401,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 403,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 404,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 409,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}
{
  "code": "<string>",
  "data": "<string>",
  "detail": "<string>",
  "instance": "<string>",
  "requestId": "<string>",
  "status": 429,
  "title": "<string>",
  "traceId": "<string>",
  "type": "<string>"
}

Implementation specification

Use these field types and limits to build your integration. Download the OpenAPI document for the complete contract.

Path parameters

practiceIdstringrequired

Pattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query parameters

limitinteger

Default: 25

Minimum: 1

Maximum: 100

startingAfterstring | null
Show schema
Any of · 1: string

string

Pattern: ^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$

Any of · 2: null

null

endingBeforestring | null
Show schema
Any of · 1: string

string

Pattern: ^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$

Any of · 2: null

null

statusstring | null
Show schema
Any of · 1: string

string

Allowed: "accepted", "declined", "pending", "expired", "revoked"

Any of · 2: null

null

emailstring | null
Show schema
Any of · 1: string

string

Pattern: ^[^\s@]+@[^\s@]+\.[^\s@]+$

Any of · 2: null

null

externalIdstring | null
Show schema
Any of · 1: string

string

Any of · 2: null

null

Headers

Affinity-Versionstring

Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default.

Pin requests to 2026-09-28.

Response specifications

200Successful response

application/json

dataobject[]required
Show data fields

Array items · object

idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$

objectstringrequired

Allowed: "team_invitation"

emailstringrequired
namestring | nullrequired
Show name fields
Any of · 1: string

string

Any of · 2: null

null

statusstringrequired

Allowed: "accepted", "declined", "pending", "expired", "revoked"

rolesobject[]required
Show roles fields

Array items · object

idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^role_[0-7][0-9a-hjkmnp-tv-z]{25}$

namestringrequired
keystring | nullrequired
Show key fields
Any of · 1: string

string

Any of · 2: null

null

locationIdsany[]required
Show locationIds fields

Array items · any

All of · 1: any

any

Pattern: ^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$

createdAtstringrequired
expiresAtstringrequired
acceptedAtstring | nullrequired
Show acceptedAt fields
Any of · 1: string

string

Any of · 2: null

null

userIdany | nullrequired

This integration's mode-scoped user ID, used for draft attribution and sessions after acceptance. Null for invitations outside this integration.

Show userId fields
Any of · 1: any
All of · 1: any

any

Pattern: ^user_[0-7][0-9a-hjkmnp-tv-z]{25}$

Any of · 2: null

null

externalIdstring | nullrequired
Show externalId fields
Any of · 1: string

string

Any of · 2: null

null

memberIdany | nullrequired
Show memberId fields
Any of · 1: any
All of · 1: any

any

Pattern: ^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$

Any of · 2: null

null

prescriberIdany | nullrequired
Show prescriberId fields
Any of · 1: any
All of · 1: any

any

Pattern: ^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$

Any of · 2: null

null

personobject | nullrequired

This integration's current onboarding and account-connection state. Null for invitations outside this integration.

Show person fields
Any of · 1: object
idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^user_[0-7][0-9a-hjkmnp-tv-z]{25}$

objectstringrequired

Allowed: "team_person"

externalIdstringrequired
emailstring | nullrequired
Show email fields
Any of · 1: string

string

Any of · 2: null

null

namestring | nullrequired
Show name fields
Any of · 1: string

string

Any of · 2: null

null

statusstringrequired
invitationobject | nullrequired
Show invitation fields
Any of · 1: object
idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$

statusstringrequired

Allowed: "accepted", "declined", "pending", "expired", "revoked"

expiresAtstringrequired
rolesobject[]required
Show roles fields

Array items · object

idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^role_[0-7][0-9a-hjkmnp-tv-z]{25}$

namestringrequired
keystring | nullrequired
Show key fields
Any of · 1: string

string

Any of · 2: null

null

Any of · 2: null

null

accountobject | nullrequired
Show account fields
Any of · 1: object
accountIdstringrequired
emailVerifiedbooleanrequired
membershipIdanyrequired
Show membershipId fields
All of · 1: any

any

Pattern: ^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$

membershipStatusstringrequired
rolesobject[]required
Show roles fields

Array items · object

idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^role_[0-7][0-9a-hjkmnp-tv-z]{25}$

namestringrequired
keystring | nullrequired
Show key fields
Any of · 1: string

string

Any of · 2: null

null

prescriberConnectionobject | nullrequired
Show prescriberConnection fields
Any of · 1: object
statusstringrequired
providerobjectrequired

No additional properties

Show provider fields
idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$

namestringrequired
legalNamestringrequired
credentialsstring | nullrequired
Show credentials fields
Any of · 1: string

string

Any of · 2: null

null

phonestring | nullrequired
Show phone fields
Any of · 1: string

string

Any of · 2: null

null

addressobject | nullrequired
Show address fields
Any of · 1: object
line1stringrequired
line2string | null
Show line2 fields
Any of · 1: string

string

Any of · 2: null

null

citystringrequired
statestringrequired
postalCodestringrequired
countrystringrequired
Any of · 2: null

null

npistringrequired
practiceStatusstringrequired
licensesobject[]required
Show licenses fields

Array items · object

idanyrequired
Show id fields
All of · 1: any

any

Pattern: ^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$

statestringrequired
licenseNumberstringrequired
expiresAtstring | nullrequired
Show expiresAt fields
Any of · 1: string

string

Any of · 2: null

null

Any of · 2: null

null

Any of · 2: null

null

nextActionsstring[]required
Show nextActions fields

Array items · string

string

Any of · 2: null

null

hasMorebooleanrequired
objectstringrequired

Allowed: "list"

urlstringrequired
400HTTP 400

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

401Unauthorized

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

403Forbidden

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

404Not found

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

409Conflict

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

429Too many requests

application/json

codestringrequired
dataobject
detailstringrequired
instancestringrequired
requestIdstringrequired
statusintegerrequired

Minimum: 400

Maximum: 599

titlestringrequired
traceIdstring
typestringrequired

Format: uri

Type to search…

↑↓ navigate↵ selectEsc close