Skip to Content
Hooks

Get a hook by ID

GET
/hooks/{hook_type}/{hook_id}

Path Parameters

hook_id*string

The ID of the hook.

hook_type*string

The type of the hook.

Value in"incoming""outgoing"

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Response Body

Ok

application/json
  1. response
id*string

The UUID of the given hook

name*string

The name entered by the user (or auto-generated by Devopness) to uniquely identify the hook

type*HookType

The type of hook (incoming or outgoing)

Value in"in""out"
action_type*ActionType
Value in"check_provisioned""configure""delete""deploy""get_status""provision""reload""remove""restart""rotate_key""start""stop"
url*|

URL that triggers incoming hooks

target_url*|

URL that outgoing hooks make a request to

is_auto_generated*boolean

Indicates if the record was auto_generated by Devopness itself

requires_secret*boolean

Tells if requests to this hook must only be accepted when a HTTP header is sent with a message authentication code (HMAC) generated based on the secret provided by Devopness and shared by user with external sources

verify_ssl*boolean

Indicates if the Devopness must be verify the SSL certificate of the request

active*boolean

Determines if the hook is currently active

project_id*integer

The ID of the project

environment_id*integer

The ID of the environment

pipeline_id*|

The ID of the pipeline executed by this hook

resource_type*ResourceType

Type of an infrastructure resource managed through a Devopness environment.

Value in"application""credential""cronjob""daemon""deployment""network""network-rule""server""service""ssh-key""ssl-certificate""subnet""virtual-host"
resource_id*integer

The hooks' resource ID

settings*|
trigger_when*
secret*string

The signing secret for incoming hooks. Devopness generates one when the caller omits it; a caller-supplied secret is returned as-is. The clear value is returned only once, in the create response, and cannot be retrieved again after that.

secret_algorithm*|

The cryptographic hash function to be used by Devopness when validating digitally signed incoming requests for hooks that require secret validation

secret_header_name*|

The name of the HTTP request header from which the request digital signature should be extracted

secret_signature_has_algorithm_prefix*|

Whether the signature header value includes the algorithm prefix, for example sha256=<hex>. When false, the header contains only the raw hex HMAC.

created_by_user*|null
created_at*string

The date and time when the record was created

updated_at*string

The date and time when the record was last updated

Example Request
curl -X GET 'https://api.devopness.com/hooks/incoming/2ab973e1-9528-4d67-aff0-209d74975830' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json'
Example Response
{  "id": "f1a61a4e-4d08-11eb-9481-0242ac130004",  "name": "my-app deploy",  "type": "in",  "action_type": "deploy",  "url": "http://localhost/hooks/incoming/0a2f9b84-e9bb-4fef-b146-51847bb9e569",  "target_url": "https://fake-url-test.com/hook/12345",  "is_auto_generated": false,  "requires_secret": true,  "verify_ssl": true,  "active": true,  "project_id": 34985723,  "environment_id": 579085,  "pipeline_id": 289542,  "resource_type": "application",  "resource_id": 9056412,  "settings": {    "variables": [      {        "name": "environment_id",        "path": "data.environment.id",        "type": "integer",        "required": false,        "default_value": null      }    ]  },  "trigger_when": {    "events": [      "action.status_changed",      "action.queued",      "action.started",      "action.completed",      "action.failed"    ],    "conditions": [      {        "name": "Only trigger incoming hook on PRs of a given pull request author",        "type": "request_body",        "path": "sender.login",        "accepted_values": [          "some-one"        ]      }    ]  },  "secret": "*****",  "secret_algorithm": "sha256",  "secret_header_name": "X-Custom-Header",  "secret_signature_has_algorithm_prefix": true,  "created_by_user": {    "id": 1,    "name": "string",    "email": "user@example.com",    "url_slug": "someone",    "language": "en",    "active": true,    "created_at": "2019-09-25T15:50:48.000000Z",    "updated_at": "2019-09-25T13:52:04.000000Z"  },  "created_at": "2022-09-26T15:30:31.000000Z",  "updated_at": "2022-09-26T15:30:58.000000Z"}