openapi: 3.2.0 info: contact: email: support@herondata.io name: Support title: Heron Data Credentials API version: '2021-07-19' servers: - description: Production url: https://app.herondata.io security: - ApiKeyAuth: - key_XXX tags: - name: Credentials paths: /api/credentials/keys: get: description: 'List all API keys for the authenticated user. Returns key metadata including name, token prefix, creation date, and active status. The `last_used` field is the most recent usage timestamp, or null if usage data is not available. Full tokens are never returned - only the first 8 characters where the first 4 are "key_". ' responses: '200': content: application/json: schema: properties: keys: items: $ref: '#/components/schemas/ApiKeyWithLastUsedSchema' type: array type: object description: List of API keys summary: List API keys tags: - Credentials post: description: 'Create a new named API key for the authenticated user. The full token is returned only in this response - it cannot be retrieved again. ' requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateKeySchema' required: true responses: '201': content: application/json: schema: $ref: '#/components/schemas/ApiKeyCreatedSchema' description: API key created. The full token is only returned in this response. '400': description: Invalid request summary: Create a new API key tags: - Credentials /api/credentials/keys/{heron_id}: delete: description: 'Permanently delete an API key. This cannot be undone. Consider deactivating instead if you might need to rollback. ' parameters: - in: path name: heron_id required: true schema: type: string responses: '204': description: Key deleted '404': description: Key not found summary: Delete an API key tags: - Credentials /api/credentials/keys/{heron_id}/activate: put: description: 'Re-activate a previously deactivated API key. ' parameters: - in: path name: heron_id required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/ApiKeyStatusSchema' description: Key activated '404': description: Key not found summary: Activate an API key tags: - Credentials /api/credentials/keys/{heron_id}/deactivate: put: description: 'Deactivate an API key. The key will stop working immediately but can be re-activated later. Use this instead of deleting to allow rollback. ' parameters: - in: path name: heron_id required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/ApiKeyStatusSchema' description: Key deactivated '404': description: Key not found summary: Deactivate an API key tags: - Credentials components: schemas: ApiKeyStatusSchema: properties: heron_id: readOnly: true type: string is_active: readOnly: true type: boolean type: object CreateKeySchema: properties: name: description: A descriptive name for the key maxLength: 128 minLength: 1 type: string required: - name type: object ApiKeyCreatedSchema: properties: created: format: date-time readOnly: true type: string heron_id: readOnly: true type: string is_active: readOnly: true type: boolean name: readOnly: true type: string token: description: Full token - shown only once readOnly: true type: string token_prefix: readOnly: true type: string type: object ApiKeyWithLastUsedSchema: properties: created: format: date-time readOnly: true type: string heron_id: readOnly: true type: string is_active: readOnly: true type: boolean last_used: format: date-time readOnly: true type: - string - 'null' name: readOnly: true type: string token_prefix: readOnly: true type: string type: object securitySchemes: ApiKeyAuth: in: header name: x-api-key type: apiKey externalDocs: description: Read Tutorial url: https://docs.herondata.io/