gs-webhook-2-events (1.0.0)

Download OpenAPI specification:

Grand Shooting: help@grand-shooting.com URL: https://grand-shooting.com License: LicenseRef-Proprietary

Webhook receiver for Grand Shooting events, publishing to gs-stream-api.

This service receives webhooks from Grand Shooting when pictures or references are created, updated, or deleted. Events are then published to the gs-stream-api for further processing by other services.

Authentication

Webhook Endpoint

The webhook endpoint requires a per-client secret key passed as a query parameter (key). Each client has its own unique webhookSecretKey that is automatically generated when the client is created. The key can be regenerated at any time via the admin API.

Admin API

The admin API requires an API key passed in the x-api-key header.

Event Types

The following event types are supported:

  • pictures/create - Picture created
  • pictures/update - Picture updated
  • pictures/delete - Picture deleted
  • references/create - Reference created
  • references/update - Reference updated
  • references/delete - Reference deleted

Health

Health check endpoints

Health check

Check the health status of the service and database connection

Responses

Response samples

Content type
application/json
{
  • "status": "healthy",
  • "name": "gs-webhook-2-events",
  • "version": "1.0.0",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Readiness check

Check if the service is ready to receive traffic

Responses

Response samples

Content type
application/json
{
  • "status": "ready"
}

Webhook

Webhook receiver endpoints for Grand Shooting events

Receive webhook events

Receive webhook events from Grand Shooting.

This endpoint is called by Grand Shooting when pictures or references are created, updated, or deleted. The service validates the payload, checks if the event type is enabled for the client, and publishes the event to gs-stream-api.

path Parameters
accountId
required
integer

Grand Shooting account ID

query Parameters
key
required
string

Per-client secret key for authentication (obtain from admin API)

Request Body schema: application/json
required
account_id
required
integer

Grand Shooting account ID

topic
required
string

Event topic (e.g., pictures/create)

type
required
string
Enum: "picture" "reference"

Resource type

required
Array of integers or strings

List of affected resource IDs

Array
One of
integer
object

Resource data keyed by ID

property name*
additional property
any
picture_id
Array of integers
Deprecated

Deprecated - use ids instead

Responses

Request samples

Content type
application/json
{
  • "account_id": 12345,
  • "topic": "pictures/create",
  • "type": "picture",
  • "ids": [
    ],
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "processed": 0,
  • "failed": 0
}

Admin - Clients

Client management endpoints

List clients

Get a paginated list of all clients

Authorizations:
apiKey
query Parameters
page
integer
Default: 1
limit
integer <= 100
Default: 20

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Create client

Create a new client.

When a client is created, webhook configurations for all event types are automatically created with enabled=true.

Authorizations:
apiKey
Request Body schema: application/json
required
accountId
required
integer

Grand Shooting account ID

accountName
required
string

Client name

enabled
boolean
Default: true

Responses

Request samples

Content type
application/json
{
  • "accountId": 12345,
  • "accountName": "Acme Corp",
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "accountId": 0,
  • "accountName": "string",
  • "webhookSecretKey": "string",
  • "enabled": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "webhookConfigs": [
    ]
}

Get client

Get a client by ID

Authorizations:
apiKey
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "accountId": 0,
  • "accountName": "string",
  • "webhookSecretKey": "string",
  • "enabled": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "webhookConfigs": [
    ]
}

Update client

Update a client's name or enabled status

Authorizations:
apiKey
path Parameters
id
required
string <uuid>
Request Body schema: application/json
required
accountName
string
enabled
boolean

Responses

Request samples

Content type
application/json
{
  • "accountName": "Updated Name",
  • "enabled": false
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "accountId": 0,
  • "accountName": "string",
  • "webhookSecretKey": "string",
  • "enabled": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "webhookConfigs": [
    ]
}

Delete client

Delete a client and all associated webhook configurations

Authorizations:
apiKey
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Regenerate webhook secret key

Generate a new webhook secret key for a client.

The previous key will be invalidated immediately. Make sure to update the webhook URL in Grand Shooting with the new key after regeneration.

Authorizations:
apiKey
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "webhookSecretKey": "string"
}

Admin - Webhooks

Webhook configuration endpoints

Get webhook configurations

Get all webhook configurations for a client

Authorizations:
apiKey
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update webhook configurations

Update webhook configurations for a client (enable/disable specific event types)

Authorizations:
apiKey
path Parameters
id
required
string <uuid>
Request Body schema: application/json
required
required
Array of objects
Array
eventType
required
string
Enum: "pictures/create" "pictures/update" "pictures/delete" "references/create" "references/update" "references/delete"
enabled
required
boolean

Responses

Request samples

Content type
application/json
{
  • "configs": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Admin - Failed Events

Failed events management and replay endpoints

List failed events

Get a paginated list of failed events with optional filtering

Authorizations:
apiKey
query Parameters
page
integer
Default: 1
limit
integer <= 100
Default: 20
accountId
integer

Filter by account ID

eventType
string
Enum: "pictures/create" "pictures/update" "pictures/delete" "references/create" "references/update" "references/delete"

Filter by event type

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get failed events statistics

Get statistics about failed events

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "pending": 0,
  • "maxRetries": 0
}

Replay failed events

Manually trigger replay of failed events.

You can either:

  • Specify specific event IDs to replay
  • Set all: true to replay all events that haven't reached max retries
Authorizations:
apiKey
Request Body schema: application/json
required
ids
Array of strings <uuid> [ items <uuid > ]

Specific event IDs to replay

all
boolean

Replay all pending events

Responses

Request samples

Content type
application/json
Example
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "replayed": 0,
  • "failed": 0
}

Delete failed event

Delete a failed event (remove from retry queue)

Authorizations:
apiKey
path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}