openapi: 3.2.0 info: title: Radiant Earth API Keys API version: 1.0.0 description: 'Operations tagged API Keys across 2 of this provider''s published API definitions: radiant-earth-source-cooperative-openapi.json, radiant-earth-source-cooperative-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://source.coop/api/v1 description: Source Cooperative security: - ApiKeyAuth: [] tags: - name: API Keys paths: /accounts/{account_id}/api-keys: post: tags: - API Keys summary: Create a new API key for an account description: 'Creates a new API key for the specified account. API key expiration date must be in the future. For user accounts, you must be authenticated as the user account you are creating the API key for. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization account you are creating the API key for. Only users with the `admin` flag may create API keys for service accounts.' parameters: - in: path name: account_id required: true schema: type: string description: The ID of the account to create the API key for requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '200': description: Successfully created API key content: application/json: schema: $ref: '#/components/schemas/APIKey' '400': description: Bad request - Invalid request body or expiration date '401': description: Unauthorized - No valid session found or insufficient permissions '404': description: Not Found - Account not found '500': description: Internal server error operationId: postAccountsByAccountIdApiKeys x-operation-id-source: derived get: tags: - API Keys summary: List API keys for an account description: 'Retrieves all API keys associated with the specified account. For user accounts, you must be authenticated as the user account you are listing API keys for. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member of the organization account you are listing API keys for. Only users with the `admin` flag may list API keys for service accounts.' parameters: - in: path name: account_id required: true schema: type: string description: The ID of the account to list API keys for responses: '200': description: Successfully retrieved API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/RedactedAPIKey' '401': description: Unauthorized - No valid session found or insufficient permissions '404': description: Not Found - Account not found '500': description: Internal server error operationId: getAccountsByAccountIdApiKeys x-operation-id-source: derived servers: - url: https://source.coop/api/v1 description: Source Cooperative /api-keys/{access_key_id}: delete: tags: - API Keys summary: Revoke an API key description: Revokes (disables) the specified API key. For an API Key assigned to a User account, only the user who created the API key can revoke it. For an API Key assigned to an Organization, only organization members with `owners` or `maintainers` membership can revoke it. For an API Key assigned to a Repoisitory, only repository or organization members with `owners` or `maintainers` membership can revoke it. Users with the `admin` flag may disable any API Key. parameters: - in: path name: access_key_id required: true schema: type: string description: The access key ID of the API key to revoke responses: '200': description: Successfully revoked API key content: application/json: schema: $ref: '#/components/schemas/RedactedAPIKey' '401': description: Unauthorized - No valid session found, insufficient permissions, or API key not found '500': description: Internal server error operationId: deleteApiKeysByAccessKeyId x-operation-id-source: derived servers: - url: https://source.coop/api/v1 description: Source Cooperative /repositories/{account_id}/{repository_id}/api-keys: post: tags: - API Keys summary: Create a new API key description: Creates a new API key for the specified repository. Only users who are an `owners` or `maintainers` member of the repository or organization may create an API Key. Users with the `admin` flag may create API keys for any repository. parameters: - in: path name: account_id required: true schema: type: string description: The ID of the account - in: path name: repository_id required: true schema: type: string description: The ID of the repository to create the API key for requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/APIKeyRequest' responses: '200': description: Successfully created API key content: application/json: schema: $ref: '#/components/schemas/APIKey' '400': description: Bad request - Invalid request body or expiration date '401': description: Unauthorized - No valid session found or insufficient permissions '404': description: Not Found - Repository not found '500': description: Internal server error operationId: postRepositoriesByAccountIdByRepositoryIdApiKeys x-operation-id-source: derived get: tags: - API Keys summary: List API keys for a repository description: Retrieves all API keys associated with the specified repository. Only users who are an `owners` or `maintainers` member of the repository or organization may list API keys. Users with the `admin` flag may list API keys for any repository. parameters: - in: path name: account_id required: true schema: type: string description: The ID of the account - in: path name: repository_id required: true schema: type: string description: The ID of the repository to list API keys for responses: '200': description: Successfully retrieved API keys content: application/json: schema: type: array items: $ref: '#/components/schemas/RedactedAPIKey' '401': description: Unauthorized - No valid session found or insufficient permissions '404': description: Not Found - Repository not found '500': description: Internal server error operationId: getRepositoriesByAccountIdByRepositoryIdApiKeys x-operation-id-source: derived servers: - url: https://source.coop/api/v1 description: Source Cooperative components: schemas: APIKey: type: object properties: access_key_id: type: string minLength: 2 maxLength: 24 example: SCFOOBAR account_id: type: string minLength: 3 maxLength: 40 pattern: ^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$ example: account-id repository_id: type: string minLength: 3 maxLength: 40 pattern: ^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$ example: repository-id disabled: type: boolean expires: type: string format: date-time name: type: string minLength: 1 maxLength: 128 example: Dev Machine secret_access_key: type: string minLength: 64 maxLength: 64 required: - access_key_id - account_id - disabled - expires - name - secret_access_key APIKeyRequest: type: object properties: name: type: string example: Dev Machine expires: type: string format: date-time required: - name - expires RedactedAPIKey: type: object properties: access_key_id: type: string minLength: 2 maxLength: 24 example: SCFOOBAR account_id: type: string minLength: 3 maxLength: 40 pattern: ^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$ example: account-id repository_id: type: string minLength: 3 maxLength: 40 pattern: ^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$ example: repository-id disabled: type: boolean expires: type: string format: date-time name: type: string minLength: 1 maxLength: 128 example: Dev Machine required: - access_key_id - account_id - disabled - expires - name securitySchemes: ApiKeyAuth: type: apiKey in: header name: Authorization description: Follows the format ` ` x-refined-from: - radiant-earth-source-cooperative-openapi.json - radiant-earth-source-cooperative-openapi.yml