Invites

Endpoints for inviting team members to create their AI headshots.

List All Invites

Returns all invitations in your organization, including pending and completed invites.

GET /organization/invites

Request

curl -X GET "https://server.headshotpro.com/api/v2/organization/invites" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "invites": [
    {
      "email": "john@example.com",
      "status": "completed",
      "modelId": "507f1f77bcf86cd799439011",
      "teamId": "team_xyz789",
      "teamName": "Marketing",
      "createdAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "email": "jane@example.com",
      "status": "pending",
      "teamId": null,
      "teamName": null,
      "createdAt": "2024-01-14T09:00:00.000Z"
    }
  ]
}

Invite Status Values

StatusDescription
pendingInvite sent, user hasn't signed up yet
acceptedUser signed up but hasn't uploaded photos
revokedInvite was revoked
uploadingUser is in the onboarding/upload process
generatingAI is generating headshots
completedHeadshots are ready
deletedUser/model was deleted

Create Invite

Send an invitation to a team member. An email will be sent with instructions to complete their AI headshot session.

POST /organization/invites

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address to invite
teamIdstringNoTeam ID to assign the user to

Request

curl -X POST "https://server.headshotpro.com/api/v2/organization/invites" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "teamId": "team_xyz789"
  }'

Response

{
  "success": true,
  "input": {
    "email": "user@example.com"
  },
  "message": "Invite sent",
  "link": "https://www.headshotpro.com/auth/signup?invite=abc123",
  "id": "abc123",
  "teamId": "team_xyz789"
}

Notes

  • Credits are consumed when the user uploads photos, not when the invite is created
  • Invite links expire after 30 days
  • Duplicate invites to the same email are rejected
  • Spam protection: Pending invites are capped at credits × 2 to prevent abuse

Error Responses

StatusCodeDescription
400INVALID_REQUESTInvalid email format
400INVALID_REQUESTUser with this email already invited
402INSUFFICIENT_CREDITSNot enough credits
404NOT_FOUNDTeam not found
429INVITE_LIMIT_EXCEEDEDToo many pending invites

Get Invite by Email

Check the status of an invitation for a specific email address.

GET /organization/invites/:email

Request

curl -X GET "https://server.headshotpro.com/api/v2/organization/invites/user@example.com" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "invite": {
    "email": "user@example.com",
    "status": "uploading",
    "modelId": "507f1f77bcf86cd799439011",
    "teamId": "team_xyz789"
  }
}

Revoke Invite

Revokes an invitation and deletes associated anonymous users and models.

POST /organization/invites/revoke

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address of invite to revoke

Request

curl -X POST "https://server.headshotpro.com/api/v2/organization/invites/revoke" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com"
  }'

Response

{
  "success": true,
  "message": "Invite revoked",
  "input": {
    "email": "user@example.com"
  }
}

Notes

  • Revoking deletes both the invite and any associated model
  • Credits are refunded for unused invites
  • This action cannot be undone