Endpoints

About

Here we list all the available endpoints from Configuration API. For easily calling them, we recommend using Leaf's Postman collection.

All HTTP methods should be prepended by this service's endpoint:

https://api.withleaf.io/services/config/api

This service has the following endpoints available:

DescriptionEndpoints
Get Api Owner's ConfigurationGET /configs
Get Leaf User's ConfigurationGET /configs/{leafUserId}
Create Leaf User's ConfigurationPOST /configs/{leafUserId}
Update Api Owner's ConfigurationPATCH /configs/{leafUserId}
Update Leaf User's ConfigurationPATCH /configs/{leafUserId}
Delete Leaf User's ConfigurationDELETE /configs/{leafUserId}

Endpoints

Get Api Owner's Configuration

 GET /configs

Gets the configuration of the Api Owner.

Response

A JSON containing the configuration of the Api Owner.

TOKEN=YOUR_TOKEN
curl -X GET \
-H "Authorization: Bearer ${TOKEN}" \
"https://api.withleaf.io/services/config/api/configs"

Get Leaf User's Configuration

 GET configs/{leafUserId}

Gets the configuration of a Leaf User.

Response

A JSON containing the configuration of the Leaf User.

TOKEN=YOUR_TOKEN
LEAF_USER_ID=00000000-0000-0000-0000-000000000000
curl -X GET \
-H "Authorization: Bearer ${TOKEN}" \
"https://api.withleaf.io/services/config/api/configs/${LEAF_USER_ID}"

Create Leaf User's Configuration

 POST /configs/{leafUserId}

Creates the Configuration for the Leaf User leafUserId. A request body must be provided containing the configurations to be set. All entries are optional, any missing configuration will be inherited from the Api Owner's Configuration.

Request body example:

{
"operationsImageCreation": true,
"fieldsAutoSync": true
}

Response

A JSON containing the configuration of the Leaf User.

TOKEN=YOUR_TOKEN
LEAF_USER_ID=00000000-0000-0000-0000-000000000000
curl -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
"https://api.withleaf.io/services/config/api/configs/${LEAF_USER_ID}"

Update Api Owner's Configuration

 PATCH /configs

Updates the specified fields of Configuration for the Api Owner. A resquest body must be provided containing the configurations to be set. All entries are optional.

Request body example:

{
"operationsImageCreation": true,
"fieldsAutoSync": true
}

Response

A JSON containing the configuration of the Api Owner.

TOKEN = 'YOUR_TOKEN'
curl -X PATCH \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
'https://api.withleaf.io/services/config/api/configs'

Update Leaf User's Configuration

 PATCH /configs/{leafUserId}

Updates the specified fields of Configuration for the Leaf User leafUserId. A resquest body must be provided containing the configurations to be set. All entries are optional.

Request body example:

{
"operationsImageCreation": true,
"fieldsAutoSync": true
}

Response

A JSON containing the configuration of the Leaf User.

TOKEN=YOUR_TOKEN
LEAF_USER_ID=00000000-0000-0000-0000-000000000000
curl -X PATCH \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
"https://api.withleaf.io/services/config/api/configs/${LEAF_USER_ID}"

Delete Leaf User's Configuraiton

 DELETE /configs/{leafUserId}

Deletes the Configuration from the Leaf User leafUserId. Until a new Configuration is created, the Leaf User will inherit all configurations from the Api Owner.

TOKEN=YOUR_TOKEN
LEAF_USER_ID=00000000-0000-0000-0000-000000000000
curl -X DELETE \
-H "Authorization: Bearer ${TOKEN}" \
"https://api.withleaf.io/services/config/api/configs/${LEAF_USER_ID}"