Webhooks

Search Alt+S

Manage Webhooks within the Privacy Bee ecosystem. Webhooks make it simple for you to get the status updates you want without having to constantly query our system.

Currently Supported Webhooks:

WebhooksDescriptionReturn
scan:startedGet notified if a scan startsScanEvent object
scan:completedGet notified if a scan finishesScanEvent object
scan:not_foundGet notified if a scan does not find someone’s dataScanEvent object
scan:foundGet notified if our scans find data, this includes the data foundScanResult object
scan:failedGet notified when a scan fails to return a result.ScanEvent object
exposure:createdGet notified when an exposure is created (but not requested yet) follows a scan:found that does not already have a request.Exposure object
exposure:requestedGet notified if a delete request to a company was madeExposure object
exposure:closedGet notified if we close a request that we have made a delete request on Exposure object
person:createdGet notified if a new person is addedPerson object
person:updatedGet notified if a person is updatedPerson object
person:removedGet notified if a person is removed ID of the removed person for confirmation

GET /webhooks

Get all webhooks that have been created.

Parameters: None

Example Request

curl -X GET https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks \
     -H "Authorization": "Bearer ${ACCESS_TOKEN}" \
     -H "Content-Type: application/json" 

Return: Array<Webhook> object

Example

[
    {
        "id": 12345,
        "endpoint": "https://privacybee.com",
        "event": "scan:completed",
        "active": true,
        "secret": "vfqv0rmtuWWPBdXNPLQrQX3aDqN38WSU",
        "created_at": "2024-05-16T18:05:21Z",
        "updated_at": "2024-05-16T18:05:21Z"
    },
    {
        "id": 12346,
        "endpoint": "https://privacybee.com",
        "event": "scan:started",
        "active": true,
        "secret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
        "created_at": "2024-05-17T12:00:00Z",
        "updated_at": "2024-05-17T12:00:00Z" 
    },
    {
        "id": 12347,
        "endpoint": "https://privacybee.com",
        "event": "request:created",
        "active": false, 
        "secret": "z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4",
        "created_at": "2024-05-18T08:30:45Z",
        "updated_at": "2024-05-18T08:30:45Z"
    }
]

GET /webhooks/<id>

Get a single webhook

Parameters: ID of the webhook

FieldData TypeDescriptionExample
idintegerID of the webhook12345

Example Request

curl -X GET https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks/12345 \
     -H "Authorization: Bearer ${ACCESS_TOKEN}" \
     -H "Content-Type: application/json"

Return: Webhook object

Example

{
    "id": 12345,
    "endpoint": "https://privacybee.com",
    "event": "scan:completed",
    "active": true,
    "secret": "vfqv0rmtuWWPBdXNPLQrQX3aDqN38WSU",
    "created_at": "2024-05-16T18:05:21Z",
    "updated_at": "2024-05-16T18:05:21Z"
}

POST /webhooks

Use this endpoint to create a new webhook.

Parameters:

FieldData TypeDescriptionExample
endpointstringURL endpoint this webhook will speak tohttps://privacybee.com
eventstringoptions: scan:started, scan:completed,scan:not_found,scan:found,request:created,request:closed scan:completed
activebooleanWhether the webhook is active or nottrue

Example Request

curl -X GET "https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks/history?start_date=2024-05-16T18:05:21Z&end_date=2024-05-16T18:05:21Z&type=scan:started,scan:completed" \
     -H "Authorization: Bearer ${ACCESS_TOKEN}" \ 
     -H "Content-Type: application/json"  

Return: Webhook object

Example

{
    "id": 12345,
    "endpoint": "https://privacybee.com",
    "event": "scan:completed",
    "active": true,
    "secret": "vfqv0rmtuWWPBdXNPLQrQX3aDqN38WSU",
    "created_at": "2024-05-16T18:05:21Z",
    "updated_at": "2024-05-16T18:05:21Z"
} 

PATCH /webhooks/<id>

Use this endpoint to update the status of a webhook between active and inactive

Parameters:

FieldData TypeDescriptionExample
activebooleanWhether the webhook is activetrue

Example Request

curl -X PATCH https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks/12345 \
     -H "Authorization: Bearer ${ACCESS_TOKEN}" \
     -H "Content-Type: application/json" \
     -d '{
           "active": true
         }'

Return: Webhook object

Example

{
    "id": 12345, 
    "endpoint": "https://privacybee.com",
    "event": "scan:completed",
    "active": true,
    "secret": "vfqv0rmtuWWPBdXNPLQrQX3aDqN38WSU",
    "created_at": "2024-05-16T18:05:21Z",
    "updated_at": "2024-05-16T18:05:21Z"
}

GET /webhooks/history

Ability to search the history of all webhooks sent including status and payload information.

Parameters:

FieldData TypeDescriptionExample
start_datedatetimeIf included only events newer than this date will be returned 2024-05-16T18:05:21Z
end_datedatetimeIf included only events older than this date will be returned 2024-05-16T18:05:21Z
typestring Which events should be returning, you can include a comma separated list to have more than one scan:started,scan:completed

Example Request

curl -X GET "https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks/history?start_date=2024-05-16T18:05:21Z&end_date=2024-05-16T18:05:21Z&type=scan:started,scan:completed" \
     -H "Authorization: Bearer ACCESS_TOKEN" \  
     -H "Content-Type: application/json" 

Return: Array<WebhookHistory> object

Example

[
    {
        "id": "1e65f9157-55db-4fa7-a8ed-328299fc49cc",
        "event": "scan:completed",
        "payload": {},
        "status": "success",
        "result": "",
        "created_at": "2024-05-16T18:05:21Z"
    },
    {
        "id": "2a74f9157-55db-4fa7-a8ed-328299fc49dd",
        "event": "scan:started",
        "payload": {},
        "status": "pending",
        "result": "",
        "created_at": "2024-05-17T10:15:30Z"
    },
    {
        "id": "3b85f9157-55db-4fa7-a8ed-328299fc49ee",
        "event": "request:created",
        "payload": {},
        "status": "dispatched",  
        "result": "", 
        "created_at": "2024-05-18T14:45:00Z" 
    }
] 

DELETE /webhooks/<id>

Permanently deletes a webhook

Parameters: ID of the webhook you wish to delete

Example Request:

curl -X DELETE https://api.privacybee.com/companies/{{COMPANY_ID}}/webhooks/12345 \
     -H "Authorization: Bearer ${ACCESS_TOKEN}" \ 
     -i

Return: 204 No Content. The HTTP status code 204 No Content indicates that the server successfully processed the request, but there is no content to send in the response.

Example

HTTP/1.1 204 No Content