> For the complete documentation index, see [llms.txt](https://raia2.gitbook.io/raia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raia2.gitbook.io/raia/api-reference/super-admin-api-key.md).

# Super Admin API Key

## Get all agents via admin API key

> Fetches all agents across all organizations by admin API key, with optional filtering by status and search keyword. The response includes agent details with the owning organization, paginated.

```json
{"openapi":"3.0.0","info":{"title":"AI Agent API","version":"1.0.0"},"servers":[{"url":"https://api.raia2.com","description":"Production server"}],"security":[{"Super-Admin-Secret-Key":[]}],"components":{"securitySchemes":{"Super-Admin-Secret-Key":{"type":"apiKey","in":"header","name":"Super-Admin-Secret-Key","description":"Custom authentication header"}},"schemas":{"ExternalApiGetAllAgentsResponseDTO":{"type":"object","properties":{"currentPage":{"type":"number","description":"Current page"},"pageSize":{"type":"number","description":"Page size"},"totalItems":{"type":"number","description":"Total items"},"totalPages":{"type":"number","description":"Total pages"},"hasNextPage":{"type":"boolean","description":"Has next page"},"hasPreviousPage":{"type":"boolean","description":"Has previous page"},"data":{"description":"Agents for the requested page.","type":"array","items":{"$ref":"#/components/schemas/ExternalApiSuperAdminAgentResponseDTO"}}},"required":["currentPage","pageSize","totalItems","totalPages","hasNextPage","hasPreviousPage","data"]},"ExternalApiSuperAdminAgentResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Agent ID.","format":"uuid"},"name":{"type":"string","description":"Agent name."},"publicName":{"type":"string","description":"Agent public name."},"description":{"type":"string","nullable":true,"description":"Agent description."},"status":{"type":"string","enum":["active","inactive","draft"],"description":"Agent status."},"organizationId":{"type":"string","description":"ID of the organization that owns the agent.","format":"uuid"},"organization":{"description":"Organization that owns the agent.","allOf":[{"$ref":"#/components/schemas/ExternalApiAgentOrganizationResponseDTO"}]},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"}},"required":["id","name","publicName","description","status","organizationId","organization","createdAt","updatedAt"]},"ExternalApiAgentOrganizationResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID.","format":"uuid"},"name":{"type":"string","description":"Organization name."},"status":{"type":"string","enum":["active","pending","archived","blocked"],"description":"Organization status."}},"required":["id","name","status"]},"ForbiddenErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":403},"name":{"type":"object","default":"FORBIDDEN_ERROR"},"message":{"type":"string","default":"INVALID_CREDENTIALS"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"InternalServerErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":500},"message":{"type":"string","default":"Internal Server Error"}},"required":["status","message"]}}},"paths":{"/external/agents":{"get":{"description":"Fetches all agents across all organizations by admin API key, with optional filtering by status and search keyword. The response includes agent details with the owning organization, paginated.","operationId":"ExternalApiAgentsController_getAllAgents","parameters":[{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"Page size","schema":{"type":"number"}},{"name":"orderBy","required":false,"in":"query","description":"Order by","schema":{"type":"string","enum":["createdAt","name","publicName","updatedAt"]}},{"name":"orderDirection","required":false,"in":"query","description":"Order direction","schema":{"type":"string","enum":["ASC","DESC"]}},{"name":"searchKeyword","required":false,"in":"query","description":"Case-insensitive keyword matched against the agent name or public name.","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Agent status.","schema":{"type":"string","enum":["active","inactive","draft"]}}],"responses":{"200":{"description":"Successfully retrieved agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalApiGetAllAgentsResponseDTO"}}}},"403":{"description":"Invalid API key or secret key. Ensure that you are using a valid authentication key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"429":{"description":"Rate limit exceeded. Each organization is limited to 1000 requests per 60 seconds for system external API operations."},"500":{"description":"Unexpected error occurred while processing the request. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get all agents via admin API key","tags":["Super Admin API Key","Agents"]}}}}
```

## Get all organizations via admin API key

> Fetches all organizations by admin API key, with optional filtering by status and search keyword. The response includes organization details with the subscription and agent count, paginated.

```json
{"openapi":"3.0.0","info":{"title":"AI Agent API","version":"1.0.0"},"servers":[{"url":"https://api.raia2.com","description":"Production server"}],"security":[{"Super-Admin-Secret-Key":[]}],"components":{"securitySchemes":{"Super-Admin-Secret-Key":{"type":"apiKey","in":"header","name":"Super-Admin-Secret-Key","description":"Custom authentication header"}},"schemas":{"ExternalApiGetAllOrganizationsResponseDTO":{"type":"object","properties":{"currentPage":{"type":"number","description":"Current page"},"pageSize":{"type":"number","description":"Page size"},"totalItems":{"type":"number","description":"Total items"},"totalPages":{"type":"number","description":"Total pages"},"hasNextPage":{"type":"boolean","description":"Has next page"},"hasPreviousPage":{"type":"boolean","description":"Has previous page"},"data":{"description":"Organizations for the requested page.","type":"array","items":{"$ref":"#/components/schemas/ExternalApiOrganizationWithSubscriptionResponseDTO"}}},"required":["currentPage","pageSize","totalItems","totalPages","hasNextPage","hasPreviousPage","data"]},"ExternalApiOrganizationWithSubscriptionResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID.","format":"uuid"},"name":{"type":"string","description":"Organization name."},"status":{"type":"string","enum":["active","pending","archived","blocked"],"description":"Organization status."},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"createdBy":{"description":"Created by.","allOf":[{"$ref":"#/components/schemas/ExternalApiCreatedByDTO"}]},"subscription":{"nullable":true,"description":"Organization subscription, or null when the organization has no subscription.","type":"object","allOf":[{"$ref":"#/components/schemas/ExternalApiSubscriptionResponseDTO"}]},"agentsCount":{"type":"number","description":"Number of agents in the organization."}},"required":["id","name","status","createdAt","updatedAt","createdBy","subscription","agentsCount"]},"ExternalApiCreatedByDTO":{"type":"object","properties":{"id":{"type":"string","description":"ID of the creator.","format":"uuid"},"email":{"type":"string","description":"Email of the creator."},"firstName":{"type":"string","description":"First name of the creator."},"lastName":{"type":"string","description":"Last name of the creator."}},"required":["id","email","firstName","lastName"]},"ExternalApiSubscriptionResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Subscription ID.","format":"uuid"},"title":{"type":"string","description":"Subscription title."},"description":{"type":"string","description":"Subscription description."},"agentsAmount":{"type":"number","description":"Number of agents in the subscription."},"tokensAmountPerMonth":{"type":"number","description":"OpenAI tokens amount in the subscription."},"secondsAmountPerMonth":{"type":"number","description":"Vapi seconds amount in the subscription."},"smsAmountPerMonth":{"type":"number","description":"Number of SMS in the subscription."},"emailsAmountPerMonth":{"type":"number","description":"Number of Emails in the subscription."},"usersWithAccessAmount":{"type":"number","description":"Number of users in organizations."},"status":{"type":"string","enum":["active","inactive"],"description":"Subscription status."},"visibility":{"type":"string","enum":["public","private"],"description":"Subscription visibility."},"isTrial":{"type":"boolean","description":"True if subscription is trial."},"createdBy":{"description":"Created by.","allOf":[{"$ref":"#/components/schemas/ExternalApiCreatedByDTO"}]},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"organizationsCount":{"type":"number","description":"Number of organizations with current subscription."},"price":{"type":"number","description":"Subscription in cent."}},"required":["id","title","description","agentsAmount","tokensAmountPerMonth","secondsAmountPerMonth","smsAmountPerMonth","emailsAmountPerMonth","usersWithAccessAmount","status","visibility","isTrial","createdBy","createdAt","updatedAt","organizationsCount","price"]},"ForbiddenErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":403},"name":{"type":"object","default":"FORBIDDEN_ERROR"},"message":{"type":"string","default":"INVALID_CREDENTIALS"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"InternalServerErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":500},"message":{"type":"string","default":"Internal Server Error"}},"required":["status","message"]}}},"paths":{"/external/organizations":{"get":{"description":"Fetches all organizations by admin API key, with optional filtering by status and search keyword. The response includes organization details with the subscription and agent count, paginated.","operationId":"ExternalApiOrganizationsController_getAllOrganizations","parameters":[{"name":"page","required":false,"in":"query","description":"Page number","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"Page size","schema":{"type":"number"}},{"name":"orderBy","required":false,"in":"query","description":"Order by","schema":{"type":"string","enum":["createdAt","name","updatedAt"]}},{"name":"orderDirection","required":false,"in":"query","description":"Order direction","schema":{"type":"string","enum":["ASC","DESC"]}},{"name":"searchKeyword","required":false,"in":"query","description":"Case-insensitive keyword matched against the organization name or ID.","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Organization status.","schema":{"type":"string","enum":["active","pending","archived","blocked"]}}],"responses":{"200":{"description":"Successfully retrieved organizations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalApiGetAllOrganizationsResponseDTO"}}}},"403":{"description":"Invalid API key or secret key. Ensure that you are using a valid authentication key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"429":{"description":"Rate limit exceeded. Each organization is limited to 1000 requests per 60 seconds for system external API operations."},"500":{"description":"Unexpected error occurred while processing the request. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get all organizations via admin API key","tags":["Super Admin API Key","Organizations"]}}}}
```

## Create organization via admin API key

> Creates an organization by admin API key. The response includes organization details.

```json
{"openapi":"3.0.0","info":{"title":"AI Agent API","version":"1.0.0"},"servers":[{"url":"https://api.raia2.com","description":"Production server"}],"security":[{"Super-Admin-Secret-Key":[]}],"components":{"securitySchemes":{"Super-Admin-Secret-Key":{"type":"apiKey","in":"header","name":"Super-Admin-Secret-Key","description":"Custom authentication header"}},"schemas":{"ExternalApiCreateOrganizationByApiKeyBodyDTO":{"type":"object","properties":{"name":{"type":"string","description":"Organization name.","maxLength":255},"users":{"description":"List of invited users.","type":"array","items":{"$ref":"#/components/schemas/ExternalApiInviteUserBodyDTO"}},"licenseKey":{"type":"string","description":"Organization license key."},"endedAt":{"format":"date-time","type":"string","description":"Subscription end date. Applies if \"subscriptionId\" is specified and this subscription is not a trial."}},"required":["name","users","licenseKey"]},"ExternalApiInviteUserBodyDTO":{"type":"object","properties":{"email":{"type":"string","description":"Invited user email.","minLength":4,"maxLength":255},"role":{"type":"string","enum":["owner","admin","manager","user","copilot_user","copilot_admin","guest"],"description":"Invited user role."}},"required":["email","role"]},"ExternalApiGetOrganizationResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID.","format":"uuid"},"name":{"type":"string","description":"Organization name."},"status":{"type":"string","enum":["active","pending","archived","blocked"],"description":"Organization status."},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"createdBy":{"description":"Created by.","allOf":[{"$ref":"#/components/schemas/ExternalApiCreatedByDTO"}]},"subscription":{"description":"Organization subscription.","allOf":[{"$ref":"#/components/schemas/ExternalApiSubscriptionResponseDTO"}]}},"required":["id","name","status","createdAt","updatedAt","createdBy","subscription"]},"ExternalApiCreatedByDTO":{"type":"object","properties":{"id":{"type":"string","description":"ID of the creator.","format":"uuid"},"email":{"type":"string","description":"Email of the creator."},"firstName":{"type":"string","description":"First name of the creator."},"lastName":{"type":"string","description":"Last name of the creator."}},"required":["id","email","firstName","lastName"]},"ExternalApiSubscriptionResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Subscription ID.","format":"uuid"},"title":{"type":"string","description":"Subscription title."},"description":{"type":"string","description":"Subscription description."},"agentsAmount":{"type":"number","description":"Number of agents in the subscription."},"tokensAmountPerMonth":{"type":"number","description":"OpenAI tokens amount in the subscription."},"secondsAmountPerMonth":{"type":"number","description":"Vapi seconds amount in the subscription."},"smsAmountPerMonth":{"type":"number","description":"Number of SMS in the subscription."},"emailsAmountPerMonth":{"type":"number","description":"Number of Emails in the subscription."},"usersWithAccessAmount":{"type":"number","description":"Number of users in organizations."},"status":{"type":"string","enum":["active","inactive"],"description":"Subscription status."},"visibility":{"type":"string","enum":["public","private"],"description":"Subscription visibility."},"isTrial":{"type":"boolean","description":"True if subscription is trial."},"createdBy":{"description":"Created by.","allOf":[{"$ref":"#/components/schemas/ExternalApiCreatedByDTO"}]},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"organizationsCount":{"type":"number","description":"Number of organizations with current subscription."},"price":{"type":"number","description":"Subscription in cent."}},"required":["id","title","description","agentsAmount","tokensAmountPerMonth","secondsAmountPerMonth","smsAmountPerMonth","emailsAmountPerMonth","usersWithAccessAmount","status","visibility","isTrial","createdBy","createdAt","updatedAt","organizationsCount","price"]},"ForbiddenErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":403},"name":{"type":"object","default":"FORBIDDEN_ERROR"},"message":{"type":"string","default":"INVALID_CREDENTIALS"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"EntityNotFoundErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":404},"name":{"type":"object","default":"ENTITY_NOT_FOUND_ERROR"},"message":{"type":"string","default":"ENTITY_NOT_FOUND"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"InternalServerErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":500},"message":{"type":"string","default":"Internal Server Error"}},"required":["status","message"]}}},"paths":{"/external/organizations":{"post":{"description":"Creates an organization by admin API key. The response includes organization details.","operationId":"ExternalApiOrganizationsController_createOrganizationByApiKey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalApiCreateOrganizationByApiKeyBodyDTO"}}}},"responses":{"201":{"description":"Successfully created the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalApiGetOrganizationResponseDTO"}}}},"403":{"description":"Invalid API key or secret key. Ensure that you are using a valid authentication key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"404":{"description":"Subscription not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityNotFoundErrorDTO"}}}},"429":{"description":"Rate limit exceeded. Each organization is limited to 1000 requests per 60 seconds for system external API operations."},"500":{"description":"Unexpected error occurred while processing the request. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Create organization via admin API key","tags":["Super Admin API Key","Organizations"]}}}}
```

## Get subscriptions by admin API key

> Fetches subscriptions by admin API key. The response includes the subscriptions details.

```json
{"openapi":"3.0.0","info":{"title":"AI Agent API","version":"1.0.0"},"servers":[{"url":"https://api.raia2.com","description":"Production server"}],"security":[{"Super-Admin-Secret-Key":[]}],"components":{"securitySchemes":{"Super-Admin-Secret-Key":{"type":"apiKey","in":"header","name":"Super-Admin-Secret-Key","description":"Custom authentication header"}},"schemas":{"ExternalApiSubscriptionResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"Subscription ID.","format":"uuid"},"title":{"type":"string","description":"Subscription title."},"description":{"type":"string","description":"Subscription description."},"agentsAmount":{"type":"number","description":"Number of agents in the subscription."},"tokensAmountPerMonth":{"type":"number","description":"OpenAI tokens amount in the subscription."},"secondsAmountPerMonth":{"type":"number","description":"Vapi seconds amount in the subscription."},"smsAmountPerMonth":{"type":"number","description":"Number of SMS in the subscription."},"emailsAmountPerMonth":{"type":"number","description":"Number of Emails in the subscription."},"usersWithAccessAmount":{"type":"number","description":"Number of users in organizations."},"status":{"type":"string","enum":["active","inactive"],"description":"Subscription status."},"visibility":{"type":"string","enum":["public","private"],"description":"Subscription visibility."},"isTrial":{"type":"boolean","description":"True if subscription is trial."},"createdBy":{"description":"Created by.","allOf":[{"$ref":"#/components/schemas/ExternalApiCreatedByDTO"}]},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"organizationsCount":{"type":"number","description":"Number of organizations with current subscription."},"price":{"type":"number","description":"Subscription in cent."}},"required":["id","title","description","agentsAmount","tokensAmountPerMonth","secondsAmountPerMonth","smsAmountPerMonth","emailsAmountPerMonth","usersWithAccessAmount","status","visibility","isTrial","createdBy","createdAt","updatedAt","organizationsCount","price"]},"ExternalApiCreatedByDTO":{"type":"object","properties":{"id":{"type":"string","description":"ID of the creator.","format":"uuid"},"email":{"type":"string","description":"Email of the creator."},"firstName":{"type":"string","description":"First name of the creator."},"lastName":{"type":"string","description":"Last name of the creator."}},"required":["id","email","firstName","lastName"]},"ForbiddenErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":403},"name":{"type":"object","default":"FORBIDDEN_ERROR"},"message":{"type":"string","default":"INVALID_CREDENTIALS"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"InternalServerErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":500},"message":{"type":"string","default":"Internal Server Error"}},"required":["status","message"]}}},"paths":{"/external/subscriptions":{"get":{"description":"Fetches subscriptions by admin API key. The response includes the subscriptions details.","operationId":"ExternalApiSubscriptionsController_findAllPaginated","parameters":[{"name":"visibility","required":false,"in":"query","description":"Subscription visibility.","schema":{"type":"string","enum":["public","private"]}},{"name":"status","required":false,"in":"query","description":"Subscription status.","schema":{"type":"string","enum":["active","inactive"]}}],"responses":{"200":{"description":"Successfully retrieved subscriptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalApiSubscriptionResponseDTO"}}}},"403":{"description":"Invalid API key or secret key. Ensure that you are using a valid authentication key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"429":{"description":"Rate limit exceeded. Each organization is limited to 1000 requests per 60 seconds for system external API operations."},"500":{"description":"Unexpected error occurred while processing the request. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get subscriptions by admin API key","tags":["Super Admin API Key","Subscriptions"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://raia2.gitbook.io/raia/api-reference/super-admin-api-key.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
