Update a contract subscription - Gable Docs
Update a Contract Subscription
PUT /v0/contract-subscription/{id}
Update a contract subscription.
Example Requests
cURL
curl --request PUT \
--url https://demo-api.gable.ai/v0/contract-subscription/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '\n{\n "dataContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n "userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n "email": "<string>",\n "githubHandle": "<string>",\n "slackChannel": "<string>"\n}\n'
Python
import requests
url = "https://demo-api.gable.ai/v0/contract-subscription/{id}"
payload = {
"dataContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"githubHandle": "<string>",
"slackChannel": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)
JavaScript
const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataContractId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
userId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email: '<string>',
githubHandle: '<string>',
slackChannel: '<string>'
})
};
fetch('https://demo-api.gable.ai/v0/contract-subscription/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
Request Body
{
"dataContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"githubHandle": "<string>",
"slackChannel": "<string>"
}
Responses
200 OK
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"githubHandle": "<string>",
"slackChannel": "<string>"
}
404 Not Found
500 Internal Server Error
Authorizations
- X-API-KEY (header, required) - Your API key for authorization.
Path Parameters
- id (string
, required) - The UUID of the contract.
Body Parameters
- dataContractId (string
, required) - Unique identifier of the contract. - userId (string
) - The unique identifier of the user. - email (string) - The email address of the subscriber if provided.
- githubHandle (string) - The GitHub handle for the subscriber if provided.
- slackChannel (string) - The Slack channel where contract violations will be sent.