openapi: 3.2.0 info: title: APImetrics Hooks API description: API for the APImetrics platform termsOfService: http://apimetrics.io/tos/ contact: name: APIContext Support url: https://apicontext.io/ email: support@apicontext.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: v2026-09-02 tags: - name: Hooks description: 'Manage inbound hooks: workflow triggers that run when their public URL receives a request.' paths: /api/2/hooks/: get: tags: - Hooks summary: List-Hooks description: List hooks for the project, newest first. operationId: list-hooks security: - OAuth2: [] - ApiKey: [] parameters: - name: cursor in: query required: false schema: anyOf: - type: string - type: 'null' title: Cursor - name: limit in: query required: false schema: type: integer maximum: 500 minimum: 1 default: 100 title: Limit - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HookListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' put: tags: - Hooks summary: Create-Hook description: Create a hook bound to a workflow target. operationId: create-hook security: - OAuth2: [] - ApiKey: [] parameters: - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateHookRequest' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HookResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/2/hooks/{hook_key_str}: get: tags: - Hooks summary: Get-Hook description: Get a hook. operationId: get-hook security: - OAuth2: [] - ApiKey: [] parameters: - name: hook_key_str in: path required: true schema: type: string pattern: ^[A-Za-z0-9_-]+$ title: Hook ID - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HookResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - Hooks summary: Update-Hook description: Partially update a hook. operationId: update-hook security: - OAuth2: [] - ApiKey: [] parameters: - name: hook_key_str in: path required: true schema: type: string pattern: ^[A-Za-z0-9_-]+$ title: Hook ID - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateHookRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HookResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - Hooks summary: Delete-Hook description: Delete a hook, returning the deleted representation. operationId: delete-hook security: - OAuth2: [] - ApiKey: [] parameters: - name: hook_key_str in: path required: true schema: type: string pattern: ^[A-Za-z0-9_-]+$ title: Hook ID - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HookResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: HookListResponse: properties: meta: $ref: '#/components/schemas/HookListMeta' results: items: $ref: '#/components/schemas/HookResponse' type: array title: Results type: object required: - meta - results title: HookListResponse UpdateHookRequest: properties: name: anyOf: - type: string maxLength: 400 - type: 'null' title: Name description: anyOf: - type: string maxLength: 1000 - type: 'null' title: Description tags: anyOf: - items: type: string type: array - type: 'null' title: Tags save_timestamp: anyOf: - type: boolean - type: 'null' title: Save Timestamp variables: anyOf: - additionalProperties: type: string type: object - type: 'null' title: Variables additionalProperties: false type: object title: UpdateHookRequest HookResponse: properties: id: type: string title: Id guid: type: string title: Guid url: type: string title: Url target_id: type: string title: Target Id name: anyOf: - type: string - type: 'null' title: Name description: anyOf: - type: string - type: 'null' title: Description tags: items: type: string type: array title: Tags save_timestamp: type: boolean title: Save Timestamp default: false variables: additionalProperties: type: string type: object title: Variables project_id: type: string title: Project Id created: anyOf: - type: string format: date-time - type: 'null' title: Created last_update: anyOf: - type: string format: date-time - type: 'null' title: Last Update type: object required: - id - guid - url - target_id - project_id title: HookResponse CreateHookRequest: properties: name: anyOf: - type: string maxLength: 400 - type: 'null' title: Name description: anyOf: - type: string maxLength: 1000 - type: 'null' title: Description tags: anyOf: - items: type: string type: array - type: 'null' title: Tags save_timestamp: anyOf: - type: boolean - type: 'null' title: Save Timestamp variables: anyOf: - additionalProperties: type: string type: object - type: 'null' title: Variables target_id: type: string title: Target Id additionalProperties: false type: object required: - target_id title: CreateHookRequest HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError HookListMeta: properties: next_cursor: anyOf: - type: string - type: 'null' title: Next Cursor more: type: boolean title: More default: false project_id: anyOf: - type: string - type: 'null' title: Project Id type: object title: HookListMeta ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: scopes: openid: OpenID Connect identity profile: User profile email: User email address authorizationUrl: https://auth.apimetrics.io/authorize?audience=https://client.apimetrics.io tokenUrl: https://auth.apimetrics.io/oauth/token ApiKey: type: apiKey in: header name: X-Api-Key