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
Fetch model
This endpoint lists information for a given model, including information on what columns it includes.
curl --request GET \
--url https://app.getcensus.com/api/v1/sources/{source_id}/models/{model_id} \
--header 'Authorization: Bearer <token>'
{
"status": "created",
"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
}
}
Authorizations
Bearer token for the current workspace. Can be retrieved from the Workspace's settings page.
Response
Outcome of the operation.
success
, updated
, created
, not_found
, error
"created"
The type of this source object, will always be model
.
model
"model"
The id of this model.
18
The name of this model.
"New App Users"
The identifier for the dataset that corresponds to this model. A model will always have a corresponding dataset unless the model belongs to a dbt, looker, sigma recipe that has not been used in Census
12
The description for this model.
"Users that have signed up for our product in the last week."
The SQL query associated with this model.
"SELECT * FROM \"users\""
When this model was created.
"2021-10-20T02:43:07.120Z"
When this model was last updated.
"2021-10-20T02:50:35.477Z"
The compiled query associated with this model if it is built atop a DBT instance.
null
A list of columns from this model.
[
{
"name": "user_id",
"type": "character varying (256)"
},
{
"name": "full_name",
"type": "character varying (256)"
}
]
[Deprecated] Identical to dataset_id
but with a typo. Will be removed in a future version.
12
[Deprecated] The source object ID for this model. You can typically ignore this.
20
Was this page helpful?
curl --request GET \
--url https://app.getcensus.com/api/v1/sources/{source_id}/models/{model_id} \
--header 'Authorization: Bearer <token>'
{
"status": "created",
"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
}
}