openapi: 3.2.0 info: description: '# Introduction This API is documented using the **OpenAPI 2.0** specification.' title: Logz.io Manage API tokens API termsOfService: https://logz.io/about-us/terms-of-use/ contact: email: help@logz.io url: https://docs.logz.io/ license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html servers: - url: https://api.logz.io/ security: - X-API-TOKEN: [] tags: - name: Manage API tokens description: You can manage API tokens for sub accounts. paths: /v1/api-tokens/sub-account: post: operationId: CreateApiTokenRequest summary: Create a sub account API token description: 'Creates a new API token for a sub account. Must be run with an API token of the owner account. Once created, you can view the details for this new token in Manage tokens > API tokens, when you are logged in to the relevant sub account. **Note:** To activate Prometheus API over our Metrics account contact Logz.io''s support team. Please ensure to change the region in the URL to match your account''s region.' tags: - Manage API tokens responses: 200: description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiTokenResponse' 400: description: Bad Request content: application/json: schema: type: object properties: message: type: string example: Bad Request. There was an issue with the request syntax from the client. Received integer instead of expected string parameter description: Bad Request. The request cannot be completed. Errors may include malformed request syntax, invalid request message parameters, and so on. 401: description: Unauthorized content: application/json: schema: type: object properties: message: type: string example: Unauthorized. There was a problem with the authorization provided in the request. description: Unauthorized. Attempted to create an API token for a sub account with insufficient or missing credentials for the main or owner account. Please contact our Support team for access to this API feature via [help@logz.io](mailto:help@logz.io). 403: description: Forbidden content: application/json: schema: type: object properties: message: type: string example: Forbidden. Attempted to create an API token for a sub account using an illegal owner account token. description: Forbidden. Attempted to create an API token for a sub account with an invalid owner account token. This operation requires a valid API token for the owner account. 404: description: Not Found content: application/json: schema: type: object properties: message: type: string example: Not Found. Could not find the sub account associated with this request. description: Not Found. Could not find the sub account associated with this request or the relevant owner account for the sub account. requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateApiTokenRequest' required: true components: schemas: CreateApiTokenRequest: type: object properties: name: type: string default: string description: The name provided in the request for a new API token for the sub account example: newTokenTest999 accountId: type: integer format: int32 description: Logz.io sub account ID. example: 160343 ApiTokenResponse: type: object properties: id: type: integer format: int32 description: ID of the newly created API token for the sub account example: 7386 name: type: string description: The name of the newly created API token for the sub account. Uses the name provided in the request. example: newTokenTest999 token: type: string description: The API token example: c498fbc3-a3ac-4676-ad09-689854b5cbbd" createdAt: type: integer format: int64 description: The time at which the new sub account API token was created example: 1621858311.0 securitySchemes: X-API-TOKEN: description: 'You can manage your API tokens from the [Logz.io API tokens](https://app.logz.io/#/dashboard/settings/manage-tokens/api) page. API tokens are account-specific. You will need to be logged into the relevant Log Management or SIEM account to view the API tokens associated with it. To manage your API tokens, log into the relevant account in your Logz.io platform, click the gear in the top-right menu, and select [**Tools > Manage tokens > API tokens**](https://app.logz.io/#/dashboard/settings/manage-tokens/api). It''s important to keep your tokens secure. API tokens carry privileges to make changes to users and accounts, so if you believe an API token has been compromised, delete it, and replace it with a new token in your integrations.' type: apiKey in: header name: X-API-TOKEN x-servers: - url: https://api.logz.io description: US East (Northern Virginia) - url: https://api-au.logz.io description: Asia Pacific (Sydney) - url: https://api-ca.logz.io description: Canada (Central) - url: https://api-eu.logz.io description: Europe (Frankfurt) - url: https://api-uk.logz.io description: Europe (London) x-tagGroups: - name: Log Monitoring tags: - Search logs - Alerts - Deployments - Insights - Logz.io snapshots - name: Cloud SIEM tags: - Security account - Security rules - Security events - Lookup lists - name: Account administration tags: - Manage users - Manage metrics account - Associated accounts - Authentication groups - Who am I - Manage time-based log accounts - Manage shared tokens - Manage API tokens - Manage notification endpoints - Import or export Kibana objects - name: Manage data shipping tags: - Manage log shipping tokens - Drop filters - Archive logs - Restore logs - Parsing - Delete object API - name: Data security tags: - Retrieve audit trail - name: Connect to AWS resources tags: - Connect to CloudTrail - Connect to S3 Buckets - name: Metrics API Gateway tags: - Grafana contact points - Grafana data source - Grafana alerting provisioning - Grafana silence management - Grafana annotations - Grafana dashboards - Grafana dashboard search - Grafana snapshots - Grafana get all folders description: Metrics API Gateway to supported endpoints.