/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { "/api_key": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * List API keys * @description List all API keys. * :::note * For more info on API keys, see [Manage your API keys](/docs/authorization/api_keys). * ::: */ get: operations["api_key:list"]; put?: never; /** * Create an API key * @description Create a new API key. * :::note * For more info on API keys, see [Manage your API keys](/docs/authorization/api_keys). * ::: */ post: operations["api_key:create"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/api_key/{id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Read an API key * @description Read an API key by ID. * * :::note * For more info on API keys, see [Manage your API keys](/docs/authorization/api_keys). * ::: */ get: operations["api_key:read"]; put?: never; post?: never; /** * Remove an API key * @description Remove an API key by ID. * :::note * For more info on API keys, see [Manage your API keys](/docs/authorization/api_keys). * ::: */ delete: operations["api_key:delete"]; options?: never; head?: never; /** * Update an API key * @description Updates an API key by ID. */ patch: operations["api_key:write"]; trace?: never; }; "/authz/grants": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Grant access to a user * @description Provide users with access to resources (NRN) in your organization. */ post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["grant:new"]; }; }; responses: { /** @description The operation was successful */ 200: { headers: { [name: string]: unknown; }; content?: never; }; }; }; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; } export type webhooks = Record; export interface components { schemas: { /** * @example { * "api_key": "MZRODUyNTA4.TMVfZC953jPorAiytA_VIrYIETUE1S7JKT0UxSDdKKjQ=" * } */ AuthTokenRequest: { /** @description Authentication API key. Include this key to obtain an initial access_token, refresh_token and organization_id. */ api_key?: string; }; /** * @example { * "refresh_token": "eyJjdHkiOiJ...", * "organization_id": 13948787 * } */ AuthTokenRequestByRefresh: { /** @description Organization ID required for refreshing the access_token using a refresh_token. */ organization_id?: string; /** @description Refresh token obtained during the initial authentication using an API key. Use this token along with the organization_id for refreshing the access_token */ refresh_token?: string; }; /** * @example { * "refresh_token": "eyJjdHki...", * "access_token": "eyJraWQi...", * "organization_id": 13948787 * } */ AuthTokenResponse: { /** @description The short-lived Bearer token that you need to pass on API calls. */ access_token: string; /** @description A long-lived token that you can use to get access tokens. */ refresh_token: string; /** @description The organization ID. */ organization_id: number; }; /** * @example { * "access_token": "eyJraWQiO...", * "organization_id": 13948787 * } */ AuthTokenByRefreshResponse: { /** @description The short-lived Bearer token that you need to pass on API calls. */ access_token: string; /** @description The organization ID. */ organization_id: number; }; /** * @example { * "name": "my-machine-process-that-will-access-nullplatform", * "grants": [ * { * "nrn": "organization=1:account=2:namespace=3:application=4", * "role_slug": "application:admin" * } * ], * "tags": [ * { * "key": "machine", * "value": "true" * } * ] * } */ "api_key:new": { /** @description A descriptive name for the API key. */ name: string; /** * @description Defines access grants for an API key. * :::info Specify either `role_id` or `role_slug`, but not both. * * ::: */ grants: { /** * @description The NRN of the resource where the API key's role is assigned. * @example organization=1:account=1:namespace=1 */ nrn: string; /** * @description The ID of the role assigned to the API key for this NRN (e.g., `560594970`). * :::note To get the `role_id`, see [Roles](/docs/authorization/roles). * * ::: * @example 560594970 */ role_id?: number; /** * @description The slug of the role assigned to the API key for this NRN (e.g., `Admin`). * :::note To get the `role_slug`, see [Roles](/docs/authorization/roles). * * ::: * @example application:admin */ role_slug?: string; }[]; tags?: { /** * @description Tag key associated with your API key. * @example CI */ key?: string; /** * @description Tag value associated with your API key. * @example main */ value?: string; }[]; }; /** * @example { * "name": "my-machine-process-that-will-access-nullplatform", * "grants": [ * { * "nrn": "organization=1:account=2:namespace=3:application=4", * "role_slug": "organization:ops" * } * ], * "tags": [ * { * "key": "machine", * "value": "true" * } * ] * } */ "api_key:write:all": { /** @description A descriptive name for the API key. */ name: string; tags: { /** * @description Tag key associated with your API key. * @example CI */ key: string; /** * @description Tag value associated with your API key. * @example main */ value: string; }[]; /** * @description Defines access grants for an API key. * :::info Specify either `role_id` or `role_slug`, but not both. * * ::: */ grants: { /** * @description The NRN of the resource where the API key's role is assigned. * @example organization=1:account=1:namespace=1 */ nrn: string; /** * @description The ID of the role assigned to the API key for this NRN (e.g., `585236512`). * :::note To get the `role_id`, see [Roles](/docs/authorization/roles). * * ::: * @example 560594970 */ role_id?: number; /** * @description The slug of the role assigned to the API key for this NRN (e.g., `Ops`). * :::note To get the `role_slug`, see [Roles](/docs/authorization/roles). * * ::: * @example organization:ops */ role_slug?: string; }[]; }; /** * @example { * "name": "my-machine-process-that-will-access-nullplatform", * "grants": [ * { * "nrn": "organization=1:account=2:namespace=3:application=4", * "role_slug": "organization:ops" * } * ], * "tags": [ * { * "key": "machine", * "value": "true" * } * ] * } */ "api_key:write": { /** @description A descriptive name for the API key. */ name?: string; tags?: { /** * @description Tag key associated with your API key. * @example CI */ key?: string; /** * @description Tag value associated with your API key. * @example main */ value?: string; }[]; /** * @description Defines access grants for an API key. * :::info Specify either `role_id` or `role_slug`, but not both. * * ::: */ grants?: { /** * @description The NRN of the resource where the API key's role is assigned. * @example organization=1:account=1:namespace=1 */ nrn: string; /** * @description The ID of the role assigned to the API key for this NRN (e.g., `585236512`). * :::note To get the `role_id`, see [Roles](/docs/authorization/roles). * * ::: * @example 560594970 */ role_id?: number; /** * @description The slug of the role assigned to the API key for this NRN (e.g., `Ops`). * :::note To get the `role_slug`, see [Roles](/docs/authorization/roles). * * ::: * @example organization:ops */ role_slug?: string; }[]; }; /** * @example { * "user_id": 1234, * "role_id": 552402968, * "nrn": "organization=1:account=2" * } */ "grant:new": { /** @description The NRN where the user will be granted the role. */ nrn?: string; /** @description The ID of the user that will **receive** the grant. */ user_id?: number; /** @description The ID of the role that will be associated to the user for this NRN. */ role_id?: number; }; apiKeyPaginatedResponse: { paging: { /** * @description The start of the paging window. Minimum is 0. * @example 0 */ offset: number; /** * @description Maximum number of elements to retrieve per call. Maximum is 200. * @example 10 */ limit: number; }; results: components["schemas"]["apiKeyResponse"][]; }; apiKeyResponse: { /** * @description Unique identifier for the entity. * @example 123 */ id: number; /** * @description The descriptive name given to the API key. * @example CI/CD Main */ name: string; /** * @description Your masked API key. * @example AAAA.xxxxxxxxxxxxxxxxxxxxxPTs= */ masked_api_key?: string | null; /** * @description Array of tags associated with your API key. * * ℹ️ If no tags are found, we return an empty array. */ tags: { /** * @description Tag key associated with your API key. * @example CI */ key: string; /** * @description Tag value associated with your API key. * @example main */ value: string; }[]; /** @description Defines access grants for an API key. */ grants: { /** * @description The NRN of the resource where the API key's role is assigned. * @example organization=1:account=1:namespace=1 */ nrn: string; /** * @description The ID of the role assigned to the API key for this NRN. * @example 560594970 */ role_id: number; /** * @description The slug of the role assigned to the API key for this NRN. * @example application:admin */ role_slug: string; }[]; /** * @description The unique ID of the owner of the API key. * @example 1595 */ owner_id?: number; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the API key was last used. * @example 2021-01-02T00:00:00Z */ last_used_at?: string | null; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the api key was created. * @example 2021-01-02T00:00:00Z */ created_at: string; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the API key was last updated. * @example 2021-01-02T00:00:00Z */ updated_at: string | null; }; apiKeyPostResponse: { /** * @description Unique identifier for the entity. * @example 123 */ id: number; /** * @description The descriptive name given to the API key. * @example CI/CD Main */ name: string; /** * @description Your newly created API key. * * :::warning Save your API key securely. * * The API key value will be displayed only once. Make sure to store it in a secure location as it cannot be retrieved later. * * ::: * @example AAAA.1234567890abcdef1234567890abcdefPTs= */ api_key: string; /** * @description Your masked API key. * @example AAAA.xxxxxxxxxxxxxxxxxxxxxPTs= */ masked_api_key?: string | null; /** * @description Array of tags associated with your API key. * * ℹ️ If no tags are found, we return an empty array. */ tags: { /** * @description Tag key associated with your API key. * @example CI */ key: string; /** * @description Tag value associated with your API key. * @example main */ value: string; }[]; /** @description Defines access grants for an API key. */ grants: { /** * @description The NRN of the resource where the API key's role is assigned. * @example organization=1:account=1:namespace=1 */ nrn: string; /** * @description The ID of the role assigned to the API key for this NRN. * @example 560594970 */ role_id: number; /** * @description The slug of the role assigned to the API key for this NRN. * @example application:admin */ role_slug: string; }[]; /** * @description The unique ID of the owner of the API key. * @example 1595 */ owner_id?: number; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the API key was last used. * @example 2021-01-02T00:00:00Z */ last_used_at?: string | null; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the API key was created. * @example 2021-01-02T00:00:00Z */ created_at: string; /** * Format: date-time * @description The ISO-8601 UTC timestamp of when the API key was last updated. * @example 2021-01-02T00:00:00Z */ updated_at: string; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { "api_key:list": { parameters: { query?: { /** @description The start of the paging window. Minimum is 0. */ limit?: string; /** @description Maximum number of elements to retrieve per call. Maximum is 200. */ offset?: number; /** @description The unique ID of the owner to query the API key. */ owner_id?: number; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["apiKeyPaginatedResponse"]; }; }; }; }; "api_key:create": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["api_key:new"]; }; }; responses: { /** @description The operation was successful. */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["apiKeyPostResponse"]; }; }; }; }; "api_key:read": { parameters: { query?: never; header?: never; path: { /** @description The unique identifier for the API key. */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["apiKeyResponse"]; }; }; }; }; "api_key:delete": { parameters: { query?: never; header?: never; path: { /** @description The unique identifier for the API key. */ id: number; }; cookie?: never; }; requestBody?: never; responses: { /** @description The operation was successful. */ 204: { headers: { [name: string]: unknown; }; content?: never; }; }; }; "api_key:write": { parameters: { query?: never; header?: never; path: { /** @description The unique identifier for the API key. */ id: number; }; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["api_key:write"]; }; }; responses: { /** @description The operation was successful. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["apiKeyResponse"]; }; }; }; }; }