# Enrollments

The Enrollments API allows businesses to programmatically invite new users to their organization, assigning them roles and workspace access from the moment of onboarding. It also provides visibility into the status of pending and processed invitations, enabling automated and auditable user onboarding workflows.

## List enrollments

> Returns a paginated list of user enrollments (invitations) for the organization filtered by status. Requires \`can\_manage\_users\` permission.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."}},"schemas":{"EnrollmentPageResponse":{"title":"EnrollmentPageResponse","type":"object","properties":{"content":{"type":"array","description":"List of enrollments","items":{"$ref":"#/components/schemas/EnrollmentResponse"}},"totalElements":{"type":"integer","description":"Total number of enrollments matching the filter"},"totalPages":{"type":"integer","description":"Total number of pages"},"size":{"type":"integer","description":"Page size"},"number":{"type":"integer","description":"Current page number (0-based)"}}},"EnrollmentResponse":{"title":"EnrollmentResponse","required":["enrollmentId","email","status"],"type":"object","properties":{"enrollmentId":{"type":"string","format":"uuid","description":"Unique identifier of the enrollment"},"email":{"type":"string","description":"Email address of the invited user"},"status":{"type":"string","description":"Current status of the enrollment","enum":["PENDING","ACCEPTED","EXPIRED","CANCELLED"]},"lastInvitationSentAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the last invitation was sent"}}},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/organizations/enrollments":{"get":{"tags":["Enrollments"],"summary":"List enrollments","description":"Returns a paginated list of user enrollments (invitations) for the organization filtered by status. Requires `can_manage_users` permission.","operationId":"list-enrollments","parameters":[{"name":"status","in":"query","description":"Filter enrollments by status (default PENDING)","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["PENDING","ACCEPTED","EXPIRED","CANCELLED"]}}},{"name":"page","in":"query","description":"Page number (0-based)","required":false,"schema":{"type":"integer","default":0}},{"name":"size","in":"query","description":"Page size (default 20)","required":false,"schema":{"type":"integer","default":20}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`). Pass the token directly without Bearer prefix.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","headers":{"Content-Type":{"description":"Content type of the response","style":"simple","explode":false,"schema":{"type":"string"}}},"content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/EnrollmentPageResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Invite a user to the organization

> Send an invitation to a user to join the organization with a specified role and optional workspace assignments. Requires \`can\_manage\_users\` permission.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."}},"schemas":{"EnrollUserRequest":{"title":"EnrollUserRequest","required":["email","roleId"],"type":"object","properties":{"email":{"type":"string","description":"Email address of the user to invite"},"roleId":{"type":"string","format":"uuid","description":"Identifier of the organization role to assign"},"firstName":{"type":"string","nullable":true,"description":"First name of the user"},"lastName":{"type":"string","nullable":true,"description":"Last name of the user"},"title":{"type":"string","nullable":true,"description":"Job title of the user"},"workspaceAssignments":{"type":"array","description":"Optional workspace assignments for the invited user","items":{"$ref":"#/components/schemas/WorkspaceAssignmentRequest"}}}},"WorkspaceAssignmentRequest":{"title":"WorkspaceAssignmentRequest","required":["workspaceId","roleId"],"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","description":"Identifier of the workspace"},"roleId":{"type":"string","format":"uuid","description":"Identifier of the role to assign in this workspace"}}},"EnrollmentResponse":{"title":"EnrollmentResponse","required":["enrollmentId","email","status"],"type":"object","properties":{"enrollmentId":{"type":"string","format":"uuid","description":"Unique identifier of the enrollment"},"email":{"type":"string","description":"Email address of the invited user"},"status":{"type":"string","description":"Current status of the enrollment","enum":["PENDING","ACCEPTED","EXPIRED","CANCELLED"]},"lastInvitationSentAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the last invitation was sent"}}},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/organizations/enrollments":{"post":{"tags":["Enrollments"],"summary":"Invite a user to the organization","description":"Send an invitation to a user to join the organization with a specified role and optional workspace assignments. Requires `can_manage_users` permission.","operationId":"invite-user","parameters":[{"name":"Authorization","in":"header","description":"Organization token (`tot_`). Pass the token directly without Bearer prefix.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollUserRequest"}}},"required":true},"responses":{"201":{"description":"Created – invitation sent successfully","headers":{"Content-Type":{"description":"Content type of the response","style":"simple","explode":false,"schema":{"type":"string"}}},"content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Resend invitation

> Resend an existing enrollment invitation. Requires \`can\_manage\_users\` permission.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."}},"schemas":{"EnrollmentResponse":{"title":"EnrollmentResponse","required":["enrollmentId","email","status"],"type":"object","properties":{"enrollmentId":{"type":"string","format":"uuid","description":"Unique identifier of the enrollment"},"email":{"type":"string","description":"Email address of the invited user"},"status":{"type":"string","description":"Current status of the enrollment","enum":["PENDING","ACCEPTED","EXPIRED","CANCELLED"]},"lastInvitationSentAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the last invitation was sent"}}},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/organizations/enrollments/{enrollmentId}/resend":{"post":{"tags":["Enrollments"],"summary":"Resend invitation","description":"Resend an existing enrollment invitation. Requires `can_manage_users` permission.","operationId":"resend-invitation","parameters":[{"name":"enrollmentId","in":"path","description":"Identifier of the enrollment","required":true,"style":"simple","explode":false,"schema":{"type":"string","format":"uuid"}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`). Pass the token directly without Bearer prefix.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","headers":{"Content-Type":{"description":"Content type of the response","style":"simple","explode":false,"schema":{"type":"string"}}},"content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Cancel invitation

> Cancel a pending enrollment invitation. Requires \`can\_manage\_users\` permission.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."}},"schemas":{"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/organizations/enrollments/{enrollmentId}/cancel":{"post":{"tags":["Enrollments"],"summary":"Cancel invitation","description":"Cancel a pending enrollment invitation. Requires `can_manage_users` permission.","operationId":"cancel-invitation","parameters":[{"name":"enrollmentId","in":"path","description":"Identifier of the enrollment to cancel","required":true,"style":"simple","explode":false,"schema":{"type":"string","format":"uuid"}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`). Pass the token directly without Bearer prefix.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"204 No Content"},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.transactionlink.io/docs/transactionlink-api/api-reference/enrollments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
