Skip to main content

Create Market

Create a new market for a node.

Endpoint: POST /api/v1/integration/markets

Authentication: Required (Bearer token)

Required Headers:

Authorization: Bearer <access_token>
X-Target-Server: integration

Request Body

Note: The webhook field is optional. You can create a market with or without webhook configuration.

With Webhook:

{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"webhook": {
"host": "https://webhook.example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
},
"timeout": 30
}
}

Without Webhook:

{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com"
}

Request Parameters

FieldTypeRequiredDescription
node_idstring (UUID)YesNode ID
domainstringYesMarket domain
webhookobjectNoWebhook configuration (optional)
webhook.hoststringNoWebhook host URL (required if webhook is provided)
webhook.pathstringNoWebhook path (required if webhook is provided)
webhook.methodintegerNoHTTP method (1=GET, 2=POST, etc.)
webhook.authenticationobjectNoAuthentication configuration
webhook.authentication.typeintegerNoAuthentication type (1=Basic, 2=Token)
webhook.authentication.usernamestringNoUsername (required if type=1)
webhook.authentication.passwordstringNoPassword (required if type=1)
webhook.timeoutintegerNoRequest timeout in seconds

Webhook Authentication

The authentication.type field specifies the authentication method for the webhook:

TypeValueDescription
Basic1HTTP Basic Authentication (requires username and password)
Token2Token-based authentication (requires token)

See Authentication Types for more details.

Response

Status: 201 Created

Returns the created market object.

Example cURL Request

With Webhook:

curl -X POST https://<base-url>/api/v1/integration/markets \
-H "Authorization: Bearer <access_token>" \
-H "X-Target-Server: integration" \
-H "Content-Type: application/json" \
-d '{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"webhook": {
"host": "https://webhook.example.com",
"path": "/webhook",
"method": 1,
"authentication": {
"type": 1,
"username": "user",
"password": "pass"
},
"timeout": 30
}
}'

Without Webhook:

curl -X POST https://<base-url>/api/v1/integration/markets \
-H "Authorization: Bearer <access_token>" \
-H "X-Target-Server: integration" \
-H "Content-Type: application/json" \
-d '{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com"
}'