openapi: 3.0.0 info: title: Schematic accesstokens accounts API version: '0.1' description: Schematic API x-rules-engine-schema-version: v97288f60 servers: - url: https://api.schematichq.com security: - ApiKeyAuth: [] tags: - name: accounts paths: /account-members: get: operationId: listAccountMembers summary: List account members tags: - accounts parameters: - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: q in: query description: Search filter schema: type: string description: Search filter maxLength: 512 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/AccountMemberResponseData' title: ListAccountMembersResponseData maxItems: 250 params: type: object description: Input parameters properties: ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string description: Search filter maxLength: 512 title: ListAccountMembersParams required: - data - params title: ListAccountMembersResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /account-members/{account_member_id}: get: operationId: getAccountMember summary: Get account member tags: - accounts parameters: - name: account_member_id in: path description: account_member_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/AccountMemberResponseData' params: type: object description: Input parameters title: GetAccountMemberParams required: - data - params title: GetAccountMemberResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /api-keys: get: operationId: listApiKeys summary: List api keys tags: - accounts parameters: - name: environment_id in: query schema: type: string - name: require_environment in: query required: true schema: type: boolean - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/ApiKeyResponseData' title: ListApiKeysResponseData maxItems: 250 params: type: object description: Input parameters properties: environment_id: type: string limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' require_environment: type: boolean title: ListApiKeysParams required: - data - params title: ListApiKeysResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: createApiKey summary: Create api key tags: - accounts requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateApiKeyRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/ApiKeyCreateResponseData' params: type: object description: Input parameters title: CreateApiKeyParams required: - data - params title: CreateApiKeyResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /api-keys/{api_key_id}: get: operationId: getApiKey summary: Get api key tags: - accounts parameters: - name: api_key_id in: path description: api_key_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/ApiKeyResponseData' params: type: object description: Input parameters title: GetApiKeyParams required: - data - params title: GetApiKeyResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' put: operationId: updateApiKey summary: Update api key tags: - accounts parameters: - name: api_key_id in: path description: api_key_id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateApiKeyRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/ApiKeyResponseData' params: type: object description: Input parameters title: UpdateApiKeyParams required: - data - params title: UpdateApiKeyResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' delete: operationId: deleteApiKey summary: Delete api key tags: - accounts parameters: - name: api_key_id in: path description: api_key_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteApiKeyParams required: - data - params title: DeleteApiKeyResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /api-keys/count: get: operationId: countApiKeys summary: Count api keys tags: - accounts parameters: - name: environment_id in: query schema: type: string - name: require_environment in: query required: true schema: type: boolean - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: environment_id: type: string limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' require_environment: type: boolean title: CountApiKeysParams required: - data - params title: CountApiKeysResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /audit-log: get: operationId: listAuditLogs summary: List audit logs tags: - accounts parameters: - name: actor_type in: query schema: $ref: '#/components/schemas/ActorType' - name: end_time in: query schema: type: string format: date-time - name: environment_id in: query schema: type: string - name: q in: query schema: type: string maxLength: 512 - name: start_time in: query schema: type: string format: date-time - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/AuditLogListResponseData' title: ListAuditLogsResponseData maxItems: 250 params: type: object description: Input parameters properties: actor_type: $ref: '#/components/schemas/ActorType' end_time: type: string format: date-time environment_id: type: string limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string maxLength: 512 start_time: type: string format: date-time title: ListAuditLogsParams required: - data - params title: ListAuditLogsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /audit-log/{audit_log_id}: get: operationId: getAuditLog summary: Get audit log tags: - accounts parameters: - name: audit_log_id in: path description: audit_log_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/AuditLogResponseData' params: type: object description: Input parameters title: GetAuditLogParams required: - data - params title: GetAuditLogResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /audit-log/count: get: operationId: countAuditLogs summary: Count audit logs tags: - accounts parameters: - name: actor_type in: query schema: $ref: '#/components/schemas/ActorType' - name: end_time in: query schema: type: string format: date-time - name: environment_id in: query schema: type: string - name: q in: query schema: type: string maxLength: 512 - name: start_time in: query schema: type: string format: date-time - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: actor_type: $ref: '#/components/schemas/ActorType' end_time: type: string format: date-time environment_id: type: string limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string maxLength: 512 start_time: type: string format: date-time title: CountAuditLogsParams required: - data - params title: CountAuditLogsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /environments: get: operationId: listEnvironments summary: List environments tags: - accounts parameters: - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/EnvironmentResponseData' title: ListEnvironmentsResponseData maxItems: 250 params: type: object description: Input parameters properties: ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' title: ListEnvironmentsParams required: - data - params title: ListEnvironmentsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: createEnvironment summary: Create environment tags: - accounts requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateEnvironmentRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/EnvironmentDetailResponseData' params: type: object description: Input parameters title: CreateEnvironmentParams required: - data - params title: CreateEnvironmentResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /environments/{environment_id}: get: operationId: getEnvironment summary: Get environment tags: - accounts parameters: - name: environment_id in: path description: environment_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/EnvironmentResponseData' params: type: object description: Input parameters title: GetEnvironmentParams required: - data - params title: GetEnvironmentResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' put: operationId: updateEnvironment summary: Update environment tags: - accounts parameters: - name: environment_id in: path description: environment_id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateEnvironmentRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/EnvironmentResponseData' params: type: object description: Input parameters title: UpdateEnvironmentParams required: - data - params title: UpdateEnvironmentResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' delete: operationId: deleteEnvironment summary: Delete environment tags: - accounts parameters: - name: environment_id in: path description: environment_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteEnvironmentParams required: - data - params title: DeleteEnvironmentResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /quickstart: post: operationId: quickstart summary: Quickstart tags: - accounts responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/QuickstartResp' params: type: object description: Input parameters title: QuickstartParams required: - data - params title: QuickstartResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /whoami: get: operationId: getWhoAmI summary: Get who am I tags: - accounts responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/WhoAmIResponseData' params: type: object description: Input parameters title: GetWhoAmIParams required: - data - params title: GetWhoAmIResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' components: responses: Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ApiError' ServerError: description: Server error content: application/json: schema: $ref: '#/components/schemas/ApiError' NotFound: description: Not found content: application/json: schema: $ref: '#/components/schemas/ApiError' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ApiError' BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/ApiError' schemas: ActorType: type: string enum: - api_key - app_user - stripe_app - system - temporary_access_token QuickstartResp: type: object properties: ok: type: boolean required: - ok title: QuickstartResp ApiError: type: object properties: error: type: string description: Error message required: - error ApiKeyScope: type: string enum: - admin - capture - read - write AccountMemberResponseData: type: object properties: created_at: type: string format: date-time email: type: string nullable: true id: type: string image_url: type: string nullable: true name: type: string nullable: true permissions: additionalProperties: type: array items: $ref: '#/components/schemas/AccountMemberPermission' maxItems: 64 type: object role: allOf: - $ref: '#/components/schemas/AccountMemberRole' nullable: true updated_at: type: string format: date-time required: - created_at - id - permissions - updated_at title: AccountMemberResponseData AuditLogResponseData: type: object properties: actor_type: $ref: '#/components/schemas/ActorType' api_key_id: type: string nullable: true ended_at: type: string format: date-time nullable: true environment: $ref: '#/components/schemas/EnvironmentResponseData' environment_id: type: string nullable: true id: type: string maxLength: 36 minLength: 36 method: type: string maxLength: 10 minLength: 1 req_body: type: string nullable: true resource_id: type: integer format: int64 nullable: true resource_id_string: type: string nullable: true maxLength: 256 resource_name: type: string nullable: true maxLength: 256 resource_type: type: string nullable: true maxLength: 64 resp_body: type: string nullable: true resp_code: type: integer format: int64 nullable: true maximum: 599 minimum: 100 secondary_resource: type: string nullable: true maxLength: 256 started_at: type: string format: date-time url: type: string maxLength: 2048 minLength: 1 user_id: type: string nullable: true maxLength: 256 user_name: type: string nullable: true maxLength: 256 required: - actor_type - method - id - started_at - url title: AuditLogResponseData ApiKeyResponseData: type: object properties: created_at: type: string format: date-time description: type: string nullable: true environment: $ref: '#/components/schemas/EnvironmentResponseData' environment_id: type: string nullable: true id: type: string last_used_at: type: string format: date-time nullable: true name: type: string readonly: type: boolean scopes: type: array items: $ref: '#/components/schemas/ApiKeyScope' maxItems: 50 updated_at: type: string format: date-time required: - id - created_at - name - readonly - scopes - updated_at title: ApiKeyResponseData AuditLogListResponseData: type: object properties: actor_type: $ref: '#/components/schemas/ActorType' api_key_id: type: string nullable: true ended_at: type: string format: date-time nullable: true environment: $ref: '#/components/schemas/EnvironmentResponseData' environment_id: type: string nullable: true id: type: string maxLength: 36 minLength: 36 method: type: string maxLength: 10 minLength: 1 resource_id: type: integer format: int64 nullable: true resource_id_string: type: string nullable: true maxLength: 256 resource_name: type: string nullable: true maxLength: 256 resource_type: type: string nullable: true maxLength: 64 resp_code: type: integer format: int64 nullable: true maximum: 599 minimum: 100 secondary_resource: type: string nullable: true maxLength: 256 started_at: type: string format: date-time url: type: string maxLength: 2048 minLength: 1 user_name: type: string nullable: true maxLength: 256 required: - actor_type - method - id - started_at - url title: AuditLogListResponseData DeleteResponse: type: object properties: deleted: type: boolean description: Whether the delete was successful AccountMemberPermission: type: string enum: - billing_credits_edit - companies_edit - company_users_edit - components_edit - data_exports_edit - features_edit - flag_rules_edit - flags_edit - overrides_edit - plan_billing_edit - plan_entitlements_edit - plan_versions_edit - plans_edit - webhooks_edit - webhooks_reveal_secret UpdateApiKeyRequestBody: type: object properties: description: type: string nullable: true maxLength: 256 name: type: string nullable: true maxLength: 256 minLength: 1 title: UpdateApiKeyRequestBody WhoAmIResponseData: type: object properties: account_id: type: string account_name: type: string actor_type: $ref: '#/components/schemas/ActorType' api_key_id: type: string environment_id: type: string environments: type: array items: $ref: '#/components/schemas/EnvironmentResponseData' maxItems: 1000 stripe_user_id: type: string user_id: type: string user_name: type: string required: - account_id - account_name - actor_type - environments title: WhoAmIResponseData CreateEnvironmentRequestBody: type: object properties: environment_type: $ref: '#/components/schemas/EnvironmentType' name: type: string maxLength: 256 minLength: 1 required: - name - environment_type title: CreateEnvironmentRequestBody CreateApiKeyRequestBody: type: object properties: description: type: string nullable: true maxLength: 256 environment_id: type: string nullable: true name: type: string maxLength: 256 minLength: 1 readonly: type: boolean nullable: true required: - name title: CreateApiKeyRequestBody EnvironmentDetailResponseData: type: object properties: api_keys: type: array items: $ref: '#/components/schemas/ApiKeyResponseData' maxItems: 1000 created_at: type: string format: date-time environment_type: $ref: '#/components/schemas/EnvironmentType' id: type: string name: type: string updated_at: type: string format: date-time required: - id - name - environment_type - created_at - updated_at - api_keys title: EnvironmentDetailResponseData CountResponse: type: object properties: count: type: integer description: The number of resources EnvironmentType: type: string enum: - development - production - staging AccountMemberRole: type: string enum: - admin - member UpdateEnvironmentRequestBody: type: object properties: environment_type: allOf: - $ref: '#/components/schemas/EnvironmentType' nullable: true name: type: string nullable: true maxLength: 256 minLength: 1 title: UpdateEnvironmentRequestBody EnvironmentResponseData: type: object properties: created_at: type: string format: date-time environment_type: $ref: '#/components/schemas/EnvironmentType' id: type: string name: type: string updated_at: type: string format: date-time required: - id - name - environment_type - created_at - updated_at title: EnvironmentResponseData ApiKeyCreateResponseData: type: object properties: created_at: type: string format: date-time description: type: string nullable: true environment: $ref: '#/components/schemas/EnvironmentResponseData' environment_id: type: string nullable: true id: type: string last_used_at: type: string format: date-time nullable: true name: type: string readonly: type: boolean scopes: type: array items: $ref: '#/components/schemas/ApiKeyScope' maxItems: 50 secret: type: string updated_at: type: string format: date-time required: - id - created_at - name - readonly - scopes - updated_at - secret title: ApiKeyCreateResponseData securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-Schematic-Api-Key