Consuelo exposes a GraphQL API alongside REST. Use GraphQL for flexible data fetching.
Endpoint
POST https://api.consuelohq.com/graphql
Authorization: Bearer <access_token>
Content-Type: application/json
Introspection
Query available types and fields:
query {
__schema {
types {
name
kind
fields {
name
type {
name
kind
}
}
}
}
}
People Queries
List People
query {
people(first: 20, after: null, where: { workspaceId: { eq: "ws_abc123" } }) {
edges {
node {
id
firstName
lastName
phone
email
company {
name
}
createdAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
Get Person by ID
query {
person(id: "person_123") {
id
firstName
lastName
phone
email
company {
id
name
}
activities {
edges {
node {
id
type
createdAt
}
}
}
}
}
Companies Queries
query {
companies(first: 20, where: { workspaceId: { eq: "ws_abc123" } }) {
edges {
node {
id
name
domain
employees
annualRevenue
}
}
}
}
Mutations
Create Person
mutation {
createPerson(
input: {
workspaceId: "ws_abc123"
firstName: "John"
lastName: "Smith"
phone: "+14155551234"
email: "john@example.com"
}
) {
person {
id
firstName
lastName
}
}
}
Update Person
mutation {
updatePerson(
id: "person_123"
input: { firstName: "Jane", notes: "Follow up next week" }
) {
person {
id
firstName
notes
}
}
}
Delete Person
mutation {
deletePerson(id: "person_123") {
success
}
}
GraphQL mutations require the same JWT authentication as REST endpoints. Use
your access token in the Authorization header.