Manage your organization's users, verify subscription features, and handle support requests using the GitDocAI API. This guide covers the endpoints available for administrative and operational tasks.
All endpoints require authentication. Ensure you include your bearer token in the Authorization header of your requests.
Managing Organization Users
As an organization administrator, you can invite new members, manage their roles, and configure their access grants.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Invite user | POST | /v1/organization/{organization_id}/user/invite | Sends an invitation to join the organization. |
| Get pending invites | GET | /v1/organization/{organization_id}/user/pending | Lists all invitations that have not yet been accepted. |
| Update role | PATCH | /v1/organization/{organization_id}/user/{user_id}/role | Changes a user's role (e.g., from member to admin). |
| Manage grants | PATCH | /v1/organization/{organization_id}/users/{user_id}/grants | Adds or removes specific document grants (currently restricted to readers). |
| Remove user | DELETE | /v1/organization/{organization_id}/user/{user_id} | Revokes a user's access to the organization entirely. |
Example: Inviting a new user
curl -X POST https://api.gitdocai.com/v1/organization/org_12345/user/invite
-H "Authorization: Bearer YOUR_API_TOKEN"
-H "Content-Type: application/json"
-d '{"email": "newuser@example.com", "role": "member"}'User Preferences
You can also retrieve user-specific settings across the platform.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Get preferences | GET | /preferences | List all user preferences. |
Validating Subscriptions
Before granting a user access to a premium feature or allowing them to perform an action that consumes quota, you should validate their organization's subscription status.
sequenceDiagram
participant App as Your Application
participant API as GitDocAI API
App->>API: GET /subscription/validate-feature
API-->>App: { "enabled": true }
App->>API: GET /subscription/validate-limit
alt Limit not reached
API-->>App: { "allowed": true }
App->>App: Execute Feature
else Limit reached
API-->>App: { "allowed": false }
App->>App: Show Upgrade Prompt
end| Action | Method | Endpoint |
|---|---|---|
| Get feature value | GET | /organization/{organization_id}/subscription/feature-value |
| Validate feature | GET | /organization/{organization_id}/subscription/validate-feature |
| Validate limit | GET | /organization/{organization_id}/subscription/validate-limit |
Always use validate-limit before executing heavy operations (like bulk exports or AI generations) to ensure the organization has sufficient quota remaining for the current billing cycle.
Internal Subscription Toggles (S2S)
For server-to-server integrations, you can directly toggle the active status of an organization's documentations.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Toggle active status | POST | /internal/subscriptions/{organization_id}/toggle-active | Toggle documentations active for an org (S2S). |
Managing Support Tickets
If your users encounter issues, you can programmatically create and manage support tickets on their behalf.
- 1
Create a ticket
Use
POST /organization/{organization_id}/support/ticketsto open a new support request. You will receive aticket_idin the response. - 2
Add details or messages
If the user provides more context, append it to the open ticket using
POST /organization/{organization_id}/support/tickets/{ticket_id}/messages. - 3
Check ticket status
Poll or retrieve the latest updates on the ticket using
GET /organization/{organization_id}/support/tickets/{ticket_id}.
To view all historical and active tickets for an organization, use the GET /organization/{organization_id}/support/tickets endpoint.
Global Customer Administration
The following endpoints are restricted to Global System Administrators. Standard organization API keys will receive a 403 Forbidden response if they attempt to access these routes.
These endpoints are designed for internal dashboards and reporting tools to oversee all customers on the platform.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| List customers | GET | /v1/admin/customers | Retrieves a paginated list of all registered organizations. |
| Export customers | GET | /v1/admin/customers/export | Generates a CSV file containing customer metadata and subscription statuses. |
| Customer overview | GET | /v1/admin/customers/{organization_id} | Retrieves a comprehensive administrative overview of a specific customer. |
Why am I getting a 403 error on the export endpoint?
The /v1/admin/* endpoints require a special Global Admin token. If you are using an organization-level API key, you cannot access global customer data. Ensure your integration is using the correct administrative credentials.
AI Content Management
You can leverage AI to edit documentation or generate assets programmatically.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Edit content | POST | /documentation/{organization_id}/{documentation_id}/ai/edit | Edit content using AI. |
| Generate image | POST | /documentation/{organization_id}/{documentation_id}/ai/generate-image | Generate an image with AI and store it as an asset. |