Models
Update model
Introduction
Organization APIs
- Users
- Invitations
- Workspaces
Workspace APIs
- Syncs
- Sync Management Links
- Sync Runs
- Destination Types
- Destinations
- Destination Connect Links
- Source Types
- Sources
- Source Connect Links
- Segment Management Links
- Webhooks
Models
Update model
Update certain values of a specified model
PATCH
/
sources
/
{source_id}
/
models
/
{model_id}
curl --request PATCH \
--url https://app.getcensus.com/api/v1/sources/{source_id}/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New App Users",
"query": "SELECT * FROM \"users\"",
"description": "Users that have signed up for our product in the last week."
}'
{
"status": "updated",
"data": {
"type": "model",
"id": 18,
"name": "New App Users",
"dataset_id": 12,
"description": "Users that have signed up for our product in the last week.",
"query": "SELECT * FROM \"users\"",
"created_at": "2021-10-20T02:43:07.120Z",
"updated_at": "2021-10-20T02:50:35.477Z",
"compiled_query": null,
"columns": [
{
"name": "user_id",
"type": "character varying (256)"
},
{
"name": "full_name",
"type": "character varying (256)"
}
],
"dataset_id=": 12,
"source_object_id": 20
},
"refresh_key": 1647978948
}
Authorizations
Bearer token for the current workspace. Can be retrieved from the Workspace's settings page.
Body
application/json
Response
200 - application/json
Successfully updated the model
The response is of type object
.
Was this page helpful?
curl --request PATCH \
--url https://app.getcensus.com/api/v1/sources/{source_id}/models/{model_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New App Users",
"query": "SELECT * FROM \"users\"",
"description": "Users that have signed up for our product in the last week."
}'
{
"status": "updated",
"data": {
"type": "model",
"id": 18,
"name": "New App Users",
"dataset_id": 12,
"description": "Users that have signed up for our product in the last week.",
"query": "SELECT * FROM \"users\"",
"created_at": "2021-10-20T02:43:07.120Z",
"updated_at": "2021-10-20T02:50:35.477Z",
"compiled_query": null,
"columns": [
{
"name": "user_id",
"type": "character varying (256)"
},
{
"name": "full_name",
"type": "character varying (256)"
}
],
"dataset_id=": 12,
"source_object_id": 20
},
"refresh_key": 1647978948
}