swagger: '2.0' info: title: Cloudsmith API (v1) audit-log webhooks API description: The API to the Cloudsmith Service termsOfService: https://help.cloudsmith.io contact: name: Cloudsmith Support url: https://help.cloudsmith.io email: support@cloudsmith.io license: name: MIT url: https://opensource.org/licenses/MIT version: v1 host: api.cloudsmith.io basePath: / schemes: - https consumes: - application/json produces: - application/json security: - apikey: [] - basic: [] tags: - name: webhooks paths: /webhooks/{owner}/{repo}/: parameters: - name: owner in: path required: true type: string - name: repo in: path required: true type: string get: operationId: webhooks_list summary: Get a list of all webhooks in a repository. description: Get a list of all webhooks in a repository. parameters: - name: page in: query description: A page number within the paginated result set. required: false type: integer - name: page_size in: query description: Number of results to return per page. required: false type: integer responses: '200': description: Retrieved the list of webhooks schema: type: array items: $ref: '#/definitions/RepositoryWebhook' '404': description: Owner namespace or repository not found schema: $ref: '#/definitions/ErrorDetail' '400': description: Request could not be processed (see detail). schema: $ref: '#/definitions/ErrorDetail' '422': description: Missing or invalid parameters (see detail). schema: $ref: '#/definitions/ErrorDetail' tags: - webhooks post: operationId: webhooks_create summary: Create a specific webhook in a repository. description: Create a specific webhook in a repository. parameters: - name: data in: body required: false schema: $ref: '#/definitions/RepositoryWebhookRequest' responses: '201': description: Created the specified webhook schema: $ref: '#/definitions/RepositoryWebhook' '404': description: Owner namespace or repository not found schema: $ref: '#/definitions/ErrorDetail' '400': description: Request could not be processed (see detail). schema: $ref: '#/definitions/ErrorDetail' '422': description: Missing or invalid parameters (see detail). schema: $ref: '#/definitions/ErrorDetail' tags: - webhooks /webhooks/{owner}/{repo}/{identifier}/: parameters: - name: owner in: path required: true type: string - name: repo in: path required: true type: string - name: identifier in: path required: true type: string get: operationId: webhooks_read summary: Views for working with repository webhooks. description: Views for working with repository webhooks. parameters: [] responses: '200': description: OK schema: $ref: '#/definitions/RepositoryWebhook' '400': description: Request could not be processed (see detail). schema: $ref: '#/definitions/ErrorDetail' '422': description: Missing or invalid parameters (see detail). schema: $ref: '#/definitions/ErrorDetail' tags: - webhooks patch: operationId: webhooks_partial_update summary: Update a specific webhook in a repository. description: Update a specific webhook in a repository. parameters: - name: data in: body required: false schema: $ref: '#/definitions/RepositoryWebhookRequestPatch' responses: '200': description: Updated the specified webhook schema: $ref: '#/definitions/RepositoryWebhook' '404': description: Owner namespace or repository not found schema: $ref: '#/definitions/ErrorDetail' '400': description: Request could not be processed (see detail). schema: $ref: '#/definitions/ErrorDetail' '422': description: Missing or invalid parameters (see detail). schema: $ref: '#/definitions/ErrorDetail' tags: - webhooks delete: operationId: webhooks_delete summary: Delete a specific webhook in a repository. description: Delete a specific webhook in a repository. parameters: [] responses: '204': description: Deleted the specified webhook successfully. '400': description: The webhook cannot be deleted. schema: $ref: '#/definitions/ErrorDetail' '422': description: Missing or invalid parameters (see detail). schema: $ref: '#/definitions/ErrorDetail' tags: - webhooks definitions: RepositoryWebhookRequestPatch: type: object properties: events: type: array items: type: string enum: - '*' - package.created - package.deleted - package.downloaded - package.failed - package.quarantined - package.released - package.restored - package.security_scanned - package.synced - package.syncing - package.tags_updated x-nullable: true is_active: title: Webhook Active description: If enabled, the webhook will trigger on subscribed events and send payloads to the configured target URL. type: boolean package_query: title: Package query description: The package-based search query for webhooks to fire. This uses the same syntax as the standard search used for repositories, and also supports boolean logic operators such as OR/AND/NOT and parentheses for grouping. If a package does not match, the webhook will not fire. type: string maxLength: 1024 x-nullable: true request_body_format: title: Payload Format description: 'The format of the payloads for webhook requests. Valid options are: (0) JSON, (1) JSON array, (2) form encoded JSON and (3) Handlebars template.' type: integer enum: - 0 - 1 - 2 - 3 request_body_template_format: title: Payload Template Format description: 'The format of the payloads for webhook requests. Valid options are: (0) Generic/user defined, (1) JSON and (2) XML.' type: integer enum: - 0 - 1 - 2 request_content_type: title: Content Type Header Value description: 'The value that will be sent for the ''Content Type'' header. ' type: string maxLength: 128 x-nullable: true secret_header: title: Secret Header description: The header to send the predefined secret in. This must be unique from existing headers or it won't be sent. You can use this as a form of authentication on the endpoint side. type: string pattern: ^[-\w]+$ maxLength: 64 x-nullable: true secret_value: title: Secret Value description: 'The value for the predefined secret (note: this is treated as a passphrase and is encrypted when we store it). You can use this as a form of authentication on the endpoint side.' type: string pattern: ^[^\n\r]+$ maxLength: 512 x-nullable: true signature_key: title: HMAC Signature Key description: 'The value for the signature key - This is used to generate an HMAC-based hex digest of the request body, which we send as the X-Cloudsmith-Signature header so that you can ensure that the request wasn''t modified by a malicious party (note: this is treated as a passphrase and is encrypted when we store it).' type: string maxLength: 512 minLength: 1 target_url: title: Payload URL description: The destination URL that webhook payloads will be POST'ed to. type: string format: uri maxLength: 2000 minLength: 1 templates: type: array items: $ref: '#/definitions/WebhookTemplate' x-nullable: true verify_ssl: title: Verify SSL Certificates description: If enabled, SSL certificates is verified when webhooks are sent. It's recommended to leave this enabled as not verifying the integrity of SSL certificates leaves you susceptible to Man-in-the-Middle (MITM) attacks. type: boolean ErrorDetail: required: - detail type: object properties: detail: title: Detail description: An extended message for the response. type: string minLength: 1 fields: title: Fields description: 'A Dictionary of related errors where key: Field and value: Array of Errors related to that field' type: object additionalProperties: type: array items: type: string minLength: 1 WebhookTemplate: required: - event type: object properties: event: title: Event type: string maxLength: 128 minLength: 1 template: title: Template type: string maxLength: 4096 x-nullable: true x-nullable: true RepositoryWebhookRequest: required: - events - target_url - templates type: object properties: events: type: array items: type: string enum: - '*' - package.created - package.deleted - package.downloaded - package.failed - package.quarantined - package.released - package.restored - package.security_scanned - package.synced - package.syncing - package.tags_updated x-nullable: true is_active: title: Webhook Active description: If enabled, the webhook will trigger on subscribed events and send payloads to the configured target URL. type: boolean package_query: title: Package query description: The package-based search query for webhooks to fire. This uses the same syntax as the standard search used for repositories, and also supports boolean logic operators such as OR/AND/NOT and parentheses for grouping. If a package does not match, the webhook will not fire. type: string maxLength: 1024 x-nullable: true request_body_format: title: Payload Format description: 'The format of the payloads for webhook requests. Valid options are: (0) JSON, (1) JSON array, (2) form encoded JSON and (3) Handlebars template.' type: integer enum: - 0 - 1 - 2 - 3 request_body_template_format: title: Payload Template Format description: 'The format of the payloads for webhook requests. Valid options are: (0) Generic/user defined, (1) JSON and (2) XML.' type: integer enum: - 0 - 1 - 2 request_content_type: title: Content Type Header Value description: 'The value that will be sent for the ''Content Type'' header. ' type: string maxLength: 128 x-nullable: true secret_header: title: Secret Header description: The header to send the predefined secret in. This must be unique from existing headers or it won't be sent. You can use this as a form of authentication on the endpoint side. type: string pattern: ^[-\w]+$ maxLength: 64 x-nullable: true secret_value: title: Secret Value description: 'The value for the predefined secret (note: this is treated as a passphrase and is encrypted when we store it). You can use this as a form of authentication on the endpoint side.' type: string pattern: ^[^\n\r]+$ maxLength: 512 x-nullable: true signature_key: title: HMAC Signature Key description: 'The value for the signature key - This is used to generate an HMAC-based hex digest of the request body, which we send as the X-Cloudsmith-Signature header so that you can ensure that the request wasn''t modified by a malicious party (note: this is treated as a passphrase and is encrypted when we store it).' type: string maxLength: 512 minLength: 1 target_url: title: Payload URL description: The destination URL that webhook payloads will be POST'ed to. type: string format: uri maxLength: 2000 minLength: 1 templates: type: array items: $ref: '#/definitions/WebhookTemplate' x-nullable: true verify_ssl: title: Verify SSL Certificates description: If enabled, SSL certificates is verified when webhooks are sent. It's recommended to leave this enabled as not verifying the integrity of SSL certificates leaves you susceptible to Man-in-the-Middle (MITM) attacks. type: boolean RepositoryWebhook: required: - events - target_url - templates type: object properties: created_at: title: Created at type: string format: date-time readOnly: true created_by: title: Created by type: string readOnly: true minLength: 1 created_by_url: title: Created by url type: string format: uri readOnly: true disable_reason: title: Disable reason type: integer enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 readOnly: true disable_reason_str: title: Disable reason str type: string readOnly: true minLength: 1 events: type: array items: type: string enum: - '*' - package.created - package.deleted - package.downloaded - package.failed - package.quarantined - package.released - package.restored - package.security_scanned - package.synced - package.syncing - package.tags_updated x-nullable: true identifier: title: Identifier description: 'Deprecated (23-05-15): Please use ''slug_perm'' instead. Previously: A monotonically increasing number that identified a webhook request within a repository.' type: integer readOnly: true x-nullable: true is_active: title: Webhook Active description: If enabled, the webhook will trigger on subscribed events and send payloads to the configured target URL. type: boolean is_last_response_bad: title: Is last response bad type: boolean readOnly: true last_response_status: title: Last response status type: integer readOnly: true last_response_status_str: title: Last response status str type: string readOnly: true minLength: 1 num_sent: title: Num sent type: integer readOnly: true package_query: title: Package query description: The package-based search query for webhooks to fire. This uses the same syntax as the standard search used for repositories, and also supports boolean logic operators such as OR/AND/NOT and parentheses for grouping. If a package does not match, the webhook will not fire. type: string maxLength: 1024 x-nullable: true request_body_format: title: Payload Format description: 'The format of the payloads for webhook requests. Valid options are: (0) JSON, (1) JSON array, (2) form encoded JSON and (3) Handlebars template.' type: integer enum: - 0 - 1 - 2 - 3 request_body_format_str: title: Request body format str type: string readOnly: true minLength: 1 request_body_template_format: title: Payload Template Format description: 'The format of the payloads for webhook requests. Valid options are: (0) Generic/user defined, (1) JSON and (2) XML.' type: integer enum: - 0 - 1 - 2 request_body_template_format_str: title: Request body template format str type: string readOnly: true minLength: 1 request_content_type: title: Content Type Header Value description: 'The value that will be sent for the ''Content Type'' header. ' type: string maxLength: 128 x-nullable: true secret_header: title: Secret Header description: The header to send the predefined secret in. This must be unique from existing headers or it won't be sent. You can use this as a form of authentication on the endpoint side. type: string pattern: ^[-\w]+$ maxLength: 64 x-nullable: true self_url: title: Self url type: string format: uri readOnly: true slug_perm: title: Slug perm type: string format: slug pattern: ^[-a-zA-Z0-9_]+$ readOnly: true minLength: 1 target_url: title: Payload URL description: The destination URL that webhook payloads will be POST'ed to. type: string format: uri maxLength: 2000 minLength: 1 templates: type: array items: $ref: '#/definitions/WebhookTemplate' x-nullable: true updated_at: title: Updated at type: string format: date-time readOnly: true updated_by: title: Updated by type: string readOnly: true minLength: 1 updated_by_url: title: Updated by url type: string format: uri readOnly: true verify_ssl: title: Verify SSL Certificates description: If enabled, SSL certificates is verified when webhooks are sent. It's recommended to leave this enabled as not verifying the integrity of SSL certificates leaves you susceptible to Man-in-the-Middle (MITM) attacks. type: boolean securityDefinitions: apikey: type: apiKey name: X-Api-Key in: header basic: type: basic