{"openapi":"3.0.3","info":{"title":"API Access","description":"API Access REST API Collection","contact":{"name":"Matthew Wirtz","email":"mwirtz@atlassian.com","url":"http://go/rebels"},"version":"1.0.0"},"servers":[{"url":"https://api.atlassian.com/admin/api-access/v1","description":"Atlassian API endpoint"}],"tags":[{"name":"API Token","description":"API Token APIs"},{"name":"public","description":"Public APIs"}],"paths":{"/orgs/{orgId}/api-tokens":{"get":{"tags":["API Token"],"summary":"Get all API tokens in an org","description":"Gets all [user API tokens](/cloud/admin/api-access/rest/intro/#API%20Tokens) in an organization.","operationId":"getAllApiTokensByOrgId","x-experimental":true,"parameters":[{"in":"path","name":"orgId","schema":{"type":"string"},"description":"Your organization is identified by a Unique ID. You get your organization ID and organization API key simultaneously.","required":true},{"$ref":"#/components/parameters/ApiTokenUserQuery"},{"$ref":"#/components/parameters/ApiTokenStatus"},{"$ref":"#/components/parameters/CreatedAtSearchType"},{"$ref":"#/components/parameters/CreatedAtUom"},{"$ref":"#/components/parameters/CreatedAtValue"},{"$ref":"#/components/parameters/CreatedAtFrom"},{"$ref":"#/components/parameters/CreatedAtTo"},{"$ref":"#/components/parameters/CreatedAtRangeFrom"},{"$ref":"#/components/parameters/CreatedAtRangeTo"},{"$ref":"#/components/parameters/LastActiveAtSearchType"},{"$ref":"#/components/parameters/LastActiveAtUom"},{"$ref":"#/components/parameters/LastActiveAtValue"},{"$ref":"#/components/parameters/LastActiveAtFrom"},{"$ref":"#/components/parameters/LastActiveAtTo"},{"$ref":"#/components/parameters/LastActiveAtRangeFrom"},{"$ref":"#/components/parameters/LastActiveAtRangeTo"},{"$ref":"#/components/parameters/ApiTokenSort"},{"$ref":"#/components/parameters/ApiTokenPageSize"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Returned if the request is successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenSearchResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"400":{"description":"Returned if request is not in correct format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"403":{"description":"Returned if the user does not have correct permissions to read user API tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"500":{"description":"Internal Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}}}}},"/orgs/{orgId}/api-tokens/count":{"get":{"tags":["API Token"],"summary":"Get API token count in an org","description":"Gets count of [user API tokens](/cloud/admin/api-access/rest/intro/#API%20Tokens) in an organization.","operationId":"getApiTokenCountByOrgId","x-experimental":true,"parameters":[{"in":"path","name":"orgId","schema":{"type":"string"},"description":"Your organization is identified by a Unique ID. You get your organization ID and organization API key simultaneously.","required":true},{"$ref":"#/components/parameters/ApiTokenUserQuery"},{"$ref":"#/components/parameters/ApiTokenStatus"},{"$ref":"#/components/parameters/CreatedAtSearchType"},{"$ref":"#/components/parameters/CreatedAtUom"},{"$ref":"#/components/parameters/CreatedAtValue"},{"$ref":"#/components/parameters/CreatedAtFrom"},{"$ref":"#/components/parameters/CreatedAtTo"},{"$ref":"#/components/parameters/CreatedAtRangeFrom"},{"$ref":"#/components/parameters/CreatedAtRangeTo"},{"$ref":"#/components/parameters/LastActiveAtSearchType"},{"$ref":"#/components/parameters/LastActiveAtUom"},{"$ref":"#/components/parameters/LastActiveAtValue"},{"$ref":"#/components/parameters/LastActiveAtFrom"},{"$ref":"#/components/parameters/LastActiveAtTo"},{"$ref":"#/components/parameters/LastActiveAtRangeFrom"},{"$ref":"#/components/parameters/LastActiveAtRangeTo"}],"responses":{"200":{"description":"Returned if the request is successful.","content":{"application/json":{"schema":{"type":"integer"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"400":{"description":"Returned if request is not in correct format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"403":{"description":"Returned if the user does not have correct permissions to read user API tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}},"500":{"description":"Internal Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"description":"The number of allowed requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of remaining requests in the current period.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Next period reset time (ISO 8601 - Date and time in UTC)","schema":{"type":"string","format":"ISO 8601"}}}}}}},"/v1/orgs/{orgId}/api-tokens":{"delete":{"tags":["API Token"],"operationId":"Bulk revoke Api Tokens","summary":"Bulk revoke api tokens in an organization","description":"Revokes all existing api tokens in an organizations, a token is revoked by userId.","parameters":[{"name":"orgId","in":"path","description":"Id of organization revoking the token","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successful operation"},"404":{"description":"Token Not Found in an Organization"}},"x-classifications":{"dataTypeRequest":["None"],"dataTypeResponse":["None"]}}}},"x-atlassian-narrative":{"documents":[{"title":"About","anchor":"About","body":"\nThe API Access REST APIs are:\n- Designed to empower organizations in viewing and managing how their Atlassian products can be accessed via public APIs."},{"title":"API Tokens","anchor":"API Tokens","body":"\n[API tokens](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) are a method through which users or systems can gain access to organizational data. \nUsers can create and manage their personal API tokens in their Atlassian accounts. \nThe API Access collection offers a systematic approach to observe and analyze the API tokens provisioned within your organization."},{"title":"Authentication","anchor":"Authentication","body":"Authentication is implemented via an API key. Use the API Key as a Bearer access token to authenticate the script and manage your organization. The Organization ID is used as a unique identifier in the path parameter for the organization. Copy the Organization ID and API key and keep them in a secure place. We won’t show them to you again.\n\nTo make requests to the API with the client/tool of your choice, [Create an API key and get the organization ID](https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/)."},{"title":"Rate limits","anchor":"Rate Limits","body":"A rate limit defines the maximum number of API calls an application or user can perform during a specific time frame. When this threshold is surpassed, or if CPU or total time constraints are exceeded, the application or user might encounter delays. Consequently, API requests initiated by the user or application will not succeed.\n\nIt is essential to note that all API requests are subjected to rate limits.\n\nWhen a client breach the rate limit thresholds, they get [HTTP 429 Too Many Requests](https://datatracker.ietf.org/doc/html/rfc6585#section-4) responses. The client has to wait for the rate limit counter to reset on the server before being able to make successful requests.\n\n**Rate limit response headers**\n\nThe following HTTP response headers are returned indicating the rate and threshold allowed for a client for each endpoint.\n- **X-RateLimit-Limit:** The number of allowed requests in the current period\n- **X-RateLimit-Remaining:** The number of remaining requests in the current period\n- **X-RateLimit-Reset:** Next period reset time (ISO 8601 - Date and time in UTC)"},{"title":"Version and URI","anchor":"Version and URI","body":"\nThe URIs for resources have the following structure:\n\n```\nhttps://api.atlassian.com/admin/api-access///\n```"},{"title":"Pagination","anchor":"Pagination","body":"\nThe API Access REST API uses pagination to conserve server resources and limit response size. If there are more results available after the current page, a link to the next page of results is included in the JSON. You can use the `cursor` parameter to set a specific starting point for the results."},{"title":"Experimental features","anchor":"Experimental features","body":"\nMethods marked as experimental may change without an earlier notice. We are looking for your feedback for these methods."},{"title":"Vocabulary","anchor":"Vocabulary","body":"\nThere are several concepts that are common ideas with a unique meaning in Atlassian Administration. Learn more about [terminology](https://developer.atlassian.com/cloud/admin/cloud-admin-vocabulary/) related to the cloud admin experience."}]},"components":{"parameters":{"ApiTokenUserQuery":{"in":"query","name":"q","description":"Free text search filter to be applied to API token results. Query will be applied using a fuzzy, case-insensitive search. Will target token `label`, `user.name`, and `user.email`.","schema":{"type":"string"},"required":false},"ApiTokenStatus":{"in":"query","name":"status","description":"Filter the API tokens by status to retrieve tokens of a specific type.","schema":{"type":"string","enum":["allowed","blocked"]},"required":false},"CreatedAtSearchType":{"in":"query","name":"createdAtSearchType","description":"Filter the API tokens by creation date. This parameter is **required** if searching on creation date. Depending on search type provided, additional parameters shall be supplied.","schema":{"type":"string","enum":["range","gt","lt","range_time"]},"required":false},"CreatedAtUom":{"in":"query","name":"createdAtUom","description":"Filter the API tokens by creation date. Unit of measure represents the scale of time for window search. This parameter is **required** if searching on creation date using `gt` or `lt` search.","schema":{"type":"string","enum":["day","hour","minute","week"]},"required":false},"CreatedAtValue":{"in":"query","name":"createdAtValue","description":"Filter the API tokens by creation date. This represents the value of time scale for window search. This parameter is **required** if searching on creation date using `gt` or `lt` search.","schema":{"type":"integer"},"required":false},"CreatedAtFrom":{"in":"query","name":"createdAtFrom","description":"Filter the API tokens by creation date. This represents the starting timestamp for a window search. Either this parameter or `createdAtTo` is **required** if searching on creation date using `range` search.","schema":{"type":"string","format":"ISO 8601"},"required":false},"CreatedAtTo":{"in":"query","name":"createdAtTo","description":"Filter the API tokens by creation date. This represents the ending timestamp for a window search. Either this parameter or `createdAtFrom` is **required** if searching on creation date using `range` search.","schema":{"type":"string","format":"ISO 8601"},"required":false},"CreatedAtRangeFrom":{"in":"query","name":"createdAtRangeFrom","description":"Filter the API tokens by creation date range. This represents the starting relative time window for a range time search. Either this parameter is or `createdAtRangeTo` is **required** if searching on creation date using `range_time` search.

**Note:** Range time windows use the format `1w 2d 3h 4m` where `w -> weeks, d -> days, h -> hours, m -> minutes`. Look-back is possible with the use of `-`, ex: `-3w` to indicate \"3 weeks ago.\" Values are optional and must be presented in descending order.","schema":{"type":"string","format":"1w 2d 3h 4m"},"required":false},"CreatedAtRangeTo":{"in":"query","name":"createdAtRangeTo","description":"Filter the API tokens by creation date range. This represents the ending relative time window for a range time search. Either this parameter is or `createdAtRangeFrom` is **required** if searching on creation date using `range_time` search.

**Note:** Range time windows use the format `1w 2d 3h 4m` where `w -> weeks, d -> days, h -> hours, m -> minutes`. Look-back is possible with the use of `-`, ex: `-3w` to indicate \"3 weeks ago.\" Values are optional and must be presented in descending order.","schema":{"type":"string","format":"1w 2d 3h 4m"},"required":false},"LastActiveAtSearchType":{"in":"query","name":"lastActiveAtSearchType","description":"Filter the API tokens by last active date. This parameter is **required** if searching on last active date. Depending on search type provided, additional parameters shall be supplied.","schema":{"type":"string","enum":["range","gt","lt","range_time"]},"required":false},"LastActiveAtUom":{"in":"query","name":"lastActiveAtUom","description":"Filter the API tokens by last active date. Unit of measure represents the scale of time for window search. This parameter is **required** if searching on last active date using `gt` or `lt` search.","schema":{"type":"string","enum":["day","hour","minute","week"]},"required":false},"LastActiveAtValue":{"in":"query","name":"lastActiveAtValue","description":"Filter the API tokens by last active date. This represents the value of time scale for window search. This parameter is **required** if searching on last active date using `gt` or `lt` search.","schema":{"type":"integer"},"required":false},"LastActiveAtFrom":{"in":"query","name":"lastActiveAtFrom","description":"Filter the API tokens by last active date. This represents the starting timestamp for a window search. Either this parameter or `lastActiveAtTo` is **required** if searching on last active date using `range` search.","schema":{"type":"string","format":"ISO 8601"},"required":false},"LastActiveAtTo":{"in":"query","name":"lastActiveAtTo","description":"Filter the API tokens by last active date. This represents the ending timestamp for a window search. Either this parameter or `lastActiveAtFrom` is **required** if searching on last active date using `range` search.","schema":{"type":"string","format":"ISO 8601"},"required":false},"LastActiveAtRangeFrom":{"in":"query","name":"lastActiveAtRangeFrom","description":"Filter the API tokens by last active date range. This represents the starting relative time window for a range time search. Either this parameter is or `lastActiveAtRangeTo` is **required** if searching on last active date using `range_time` search.

**Note:** Range time windows use the format `1w 2d 3h 4m` where `w -> weeks, d -> days, h -> hours, m -> minutes`. Look-back is possible with the use of `-`, ex: `-3w` to indicate \"3 weeks ago.\" Values are optional and must be presented in descending order.","schema":{"type":"string","format":"1w 2d 3h 4m"},"required":false},"LastActiveAtRangeTo":{"in":"query","name":"lastActiveAtRangeTo","description":"Filter the API tokens by last active date range. This represents the ending relative time window for a range time search. Either this parameter is or `lastActiveAtRangeFrom` is **required** if searching on last active date using `range_time` search.

**Note:** Range time windows use the format `1w 2d 3h 4m` where `w -> weeks, d -> days, h -> hours, m -> minutes`. Look-back is possible with the use of `-`, ex: `-3w` to indicate \"3 weeks ago.\" Values are optional and must be presented in descending order.","schema":{"type":"string","format":"1w 2d 3h 4m"},"required":false},"ApiTokenSort":{"in":"query","name":"sort","description":"Sort the API tokens based on the following criteria: ascending is represented with `+` as the first character (optional); descending is represented with `-` as the first character. Multiple values may be supplied as a comma-separated list.","schema":{"type":"string","enum":["label","-label","user.name","-user.name","createdAt","-createdAt","expiresAt","-expiresAt","lastActiveAt","-lastActiveAt"],"default":"-lastActiveAt","format":"[-|+], ..."},"required":false},"ApiTokenPageSize":{"in":"query","name":"pageSize","description":"Select the number of records to include in the results.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":20},"required":false},"Cursor":{"in":"query","name":"cursor","description":"Continue with a filtered set of paginated results. In a given response, it may include a `self`, `next`, and `prev` cursor to fetch the respective set of paginated results. This is a Base64 encoded representation of the applied filters, sort, page size, and iterator for subsequent searches.

**Note:** if the `cursor` is supplied, the consumer does not need to supply any additional parameters.","schema":{"type":"string"},"required":false}},"schemas":{"ApiTokenSearchResponse":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","description":"List of API tokens.","items":{"$ref":"#/components/schemas/ApiToken"}},"links":{"$ref":"#/components/schemas/Links"}},"required":["data","links"]},"ApiToken":{"type":"object","required":["id","label","status","createdAt","user"],"properties":{"id":{"type":"string","description":"The token ID generated in the token-service."},"label":{"type":"string","description":"The token label."},"status":{"type":"string","description":"The token status.","enum":["ALLOWED","BLOCKED"]},"createdAt":{"type":"string","description":"An ISO-8601 formatted timestamp representing the time when a token was created."},"expiresAt":{"type":"string","description":"An ISO-8601 formatted timestamp representing the time when a token expires."},"lastActiveAt":{"type":"string","description":"An ISO-8601 formatted timestamp representing the time when a token was last used."},"user":{"$ref":"#/components/schemas/ApiTokenUser"}}},"ApiTokenUser":{"type":"object","description":"The user associated with the token.","properties":{"id":{"type":"string","description":"User ID of the API token user."},"orgId":{"type":"string","description":"Org ID of the API token user."},"name":{"type":"string","description":"Name of the API token user."},"email":{"type":"string","description":"Email of the API token user."}},"required":["id","name","email"]},"Links":{"type":"object","properties":{"self":{"type":"string","description":"An encoded cursor object to represent the current page of records."},"next":{"type":"string","description":"An encoded cursor object to represent the next page of records."},"prev":{"type":"string","description":"An encoded cursor object to represent the previous page of records."}}},"ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","description":"List of during request.","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"id":{"type":"string","description":"A unique ID for the request."},"status":{"type":"string","description":"A HTTP status code for the error."},"code":{"type":"string","description":"A domain-specific error code.","enum":["INVALID_API_TOKEN_SEARCH_QUERY","INVALID_FIELD_FORMAT","INVALID_PAGE_SIZE","INVALID_SORT","FEATURE_NOT_ENABLED","GENERIC_ERROR"]},"title":{"type":"string","description":"A short description of the error."},"detail":{"type":"string","description":"A detailed description of the error and potential ways to address the issue."}},"required":["id","status","code","title"]}}}}