Skip to main content

Examples Using Rize's GraphQL API

Examples have been provided below to help you get started using Rize's GraphQL API.

The comprehensive schema documentation for Rize's API can be viewed from the GraphQL Playground at https://api.rize.io/api/v1/graphiql by clicking the "Show Documentation Explorer" icon in the top left.

Example Query​

This is an example using the Project query in the Rize GraphQL API.

Project Query

curl -X POST https://api.rize.io/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "query Project($id: ID!) { project(id: $id) { id name } }",
"variables": {
"id": "124119"
}
}'

Successful Response

{"data":{"project":{"id":"124119","name":"Your Project Name"}}}

Error Response

{"errors":[{"message":"Variable $id of type ID! was provided invalid value","locations":[{"line":1,"column":15}],"extensions":{"value":null,"problems":[{"path":[],"explanation":"Expected value to not be null"}]}}]}

Example Mutation​

This is an example using the CreateProject mutation in the Rize GraphQL API.

CreateProject Mutation

curl -X POST https://api.rize.io/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "mutation CreateProject($name: String!) { createProject(input: { args: { name: $name } }) { project { id name } } }",
"variables": {
"name": "Your Project Name"
}
}'

Successful Response

{"data":{"createProject":{"project":{"id":"124112319","name":"Your Project Name"}}}}

Error Response

{"data":{"createProject":null},"errors":[{"message":"You must be signed in to access mutation CreateProject","locations":[{"line":1,"column":42}],"path":["createProject"],"extensions":{"code":"AUTHENTICATION_ERROR"}}]}

Sessions in a time range​

The sessions query returns focus, meeting and break sessions plus upcoming planned sessions. The range from startTime to endTime can span at most 93 days, except for requests authenticated with the Zapier OAuth application. When you omit both, it covers the 30 days before and after now; when you omit one, it is 60 days from the other. With sort: created_at or sort: updated_at and no range, it instead returns sessions created or updated in the last 60 days, whatever their start time, which suits polling for new sessions.

Zapier keeps this creation/update polling window, so newly created backdated and far-future sessions remain discoverable. For Zapier requests using the default start_time sort, omitted start/end bounds default to September 1, 2020 and January 1, 9999. These legacy defaults also fill any missing bound when Zapier supplies an explicit start-time range. Zapier ranges have no 93-day span cap; range ordering and pagination limits still apply. Other OAuth applications, including Zapier Development, keep the standard defaults and cap.

Pass first (1–500) to page through a range. For the next page, pass the cursor of the last session you received as after, with the same sort. Keep requesting pages until one comes back empty. A page can have fewer than first sessions when a session is deleted while the page is read, so a short page does not mean it is the last. Pages are read live, not from a snapshot, so a session whose sort value changes while you page can move to a page you have already read or one you have not read yet. Use the default start_time sort for the most stable results.

Sessions Query

curl -X POST https://api.rize.io/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "query Sessions($startTime: ISO8601DateTime, $endTime: ISO8601DateTime, $first: Int, $after: String) { sessions(startTime: $startTime, endTime: $endTime, first: $first, after: $after) { id cursor title type startTime endTime } }",
"variables": {
"startTime": "2026-10-01T00:00:00Z",
"endTime": "2026-11-01T00:00:00Z",
"first": 100,
"after": null
}
}'

Error Response (range longer than 93 days, abridged)

{"data":null,"errors":[{"message":"Range must be 93 days or fewer. Split longer ranges into multiple requests.","path":["sessions"]}]}

Time entries with client and project​

timeEntries returns the current user's time entries in a time range as a connection. Each TimeEntry exposes the associated client, project, and task as nested objects; client and project are optional and return null on untagged entries. duration is in seconds and startTime/endTime are ISO 8601 strings.

This query is validated against the schema in api/app/graphql/api/v1/schema.graphql. The exact fields are also listed in the generated reference: timeEntries, TimeEntry, Client, and Project.

query TimeEntriesWithClientAndProject(
$startTime: ISO8601DateTime!
$endTime: ISO8601DateTime!
$after: String
) {
timeEntries(startTime: $startTime, endTime: $endTime, first: 50, after: $after) {
nodes {
id
title
description
startTime
endTime
duration
billable
client { id name }
project { id name client { id name } }
task { id name }
}
pageInfo { endCursor hasNextPage }
}
}
{
"startTime": "2026-09-01T00:00:00Z",
"endTime": "2026-09-08T00:00:00Z"
}

As a single curl command:

curl -X POST https://api.rize.io/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "query TimeEntriesWithClientAndProject($startTime: ISO8601DateTime!, $endTime: ISO8601DateTime!) { timeEntries(startTime: $startTime, endTime: $endTime, first: 50) { nodes { id title startTime endTime duration billable client { id name } project { id name } task { id name } } pageInfo { endCursor hasNextPage } } }",
"variables": { "startTime": "2026-09-01T00:00:00Z", "endTime": "2026-09-08T00:00:00Z" }
}'

Successful response shape:

{
"data": {
"timeEntries": {
"nodes": [
{
"id": "8812031",
"title": "Homepage redesign",
"startTime": "2026-09-02T14:00:00Z",
"endTime": "2026-09-02T15:30:00Z",
"duration": 5400,
"billable": true,
"client": { "id": "4021", "name": "Acme Co" },
"project": { "id": "124119", "name": "Website" },
"task": null
}
],
"pageInfo": { "endCursor": "MQ", "hasNextPage": false }
}
}
}

Useful arguments:

  • startTime / endTime filter by entry start time (startTime <= entry.startTime < endTime). Both default to an open-ended range, so pass them explicitly.
  • clientIds, projectIds, taskIds, and labelIds narrow results to specific records. Get the IDs from the clients, projects, tasks, or labels queries.
  • statuses defaults to [active]; pass [active, tracking] to include the entry currently being tracked.
  • teamId scopes to one workspace; omit it to include every team you can access.
  • first is capped at 500 per page. Page with after: pageInfo.endCursor while hasNextPage is true. See pagination.

Use timeEntry(id: ID!) to fetch a single entry with the same fields. To group time by client or project instead of listing entries, use timeAllocation.

Logging a Time Entry​

createProjectTimeEntry takes projectId, startTime, and endTime directly on input (no args wrapper) and returns the new entry as timeEntry. description and billable are optional. Timestamps are ISO 8601.

CreateProjectTimeEntry Mutation

curl -X POST https://api.rize.io/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "mutation CreateProjectTimeEntry($projectId: ID!, $startTime: ISO8601DateTime!, $endTime: ISO8601DateTime!, $description: String) { createProjectTimeEntry(input: { projectId: $projectId, startTime: $startTime, endTime: $endTime, description: $description }) { timeEntry { id startTime endTime duration description project { id name } } errors { message path } } }",
"variables": {
"projectId": "124112319",
"startTime": "2026-09-18T09:00:00Z",
"endTime": "2026-09-18T10:30:00Z",
"description": "Weekly planning"
}
}'

Successful Response

{"data":{"createProjectTimeEntry":{"timeEntry":{"id":"98213","startTime":"2026-09-18T09:00:00Z","endTime":"2026-09-18T10:30:00Z","duration":5400,"description":"Weekly planning","project":{"id":"124112319","name":"Your Project Name"}},"errors":[]}}}

Validation failures (for example endTime before startTime) are returned as top-level GraphQL errors with a Record invalid: ... message; the payload errors field stays empty for those cases. The full list of input fields for every mutation is available through introspection or the GraphQL Playground.

Titles and departments​

Catalog reads require active workspace membership. Pass the workspace ID as workspaceId. Both queries return active records, support case-insensitive search, and use cursor pagination with 25 results by default and a maximum of 50.

query Catalogs($workspaceId: ID!, $search: String, $after: String) {
titles(workspaceId: $workspaceId, search: $search, first: 25, after: $after) {
nodes { id name department { id name } }
pageInfo { endCursor hasNextPage }
}
departments(workspaceId: $workspaceId, search: $search, first: 25) {
nodes { id name }
pageInfo { endCursor hasNextPage }
}
}

Each connection has its own cursor. The example uses after for titles; paginate departments separately with that connection's endCursor.

Workspace admins can create departments and titles with separate mutations. Run department creation first, then use its returned ID when creating a title. Pass departmentId: null to guarantee an unassigned title. Omitting departmentId leaves a new title unassigned, but preserves the previous department when restoring an archived title.

mutation NewDepartment($workspaceId: ID!, $name: String!) {
createDepartment(input: { workspaceId: $workspaceId, name: $name }) {
department { id name }
errors { path message }
}
}
mutation NewTitle($workspaceId: ID!, $name: String!, $departmentId: ID) {
createTitle(input: { workspaceId: $workspaceId, name: $name, departmentId: $departmentId }) {
title { id name department { id name } }
errors { path message }
}
}

Use updateTitle and updateDepartment for changes. For example, this mutation renames a title:

mutation RenameTitle($workspaceId: ID!, $id: ID!, $name: String!) {
updateTitle(input: { workspaceId: $workspaceId, id: $id, name: $name }) {
title { id name }
errors { path message }
}
}

Both update mutations accept archived: true to archive or archived: false to restore. updateTitle also accepts departmentId: omit it to preserve the current department, or pass null to clear it. Referenced records must belong to the same workspace, and a newly assigned department must be active.

Creating a name that matches an archived record restores that record rather than duplicating it. Matching ignores capitalization and surrounding spaces. Active duplicate names fail validation. Model validation failures return a null record and structured payload errors; authorization and unavailable-record failures can return top-level GraphQL errors. Check both when handling a response.

Archiving clears assignments asynchronously. Restoring a record does not restore assignments already cleared. See archive behavior before using these mutations.

For member metadata, request title, titleId, and department { id name } from workspaceMembers or teamMembers. The public API has no batch catalog mutations.

Time groups​

Time groups are personal sets of clients, projects, tasks, labels, members, and teams. The public API reads and writes only the caller's own groups. See Time groups for how they work in the app.

timeGroups uses cursor pagination, and each group's connectables connection is paginated the same way. Connectable kind is one of client, identity, label, project, task, or team.

query MyTimeGroups($after: String) {
timeGroups(first: 25, after: $after) {
nodes {
id
name
connectables(first: 50) { nodes { kind connectableId name } }
}
pageInfo { endCursor hasNextPage }
}
}

createTimeGroup takes a name and optional color, icon, description, and connectables. Without a color, the group gets a random palette color. updateTimeGroup takes an id and the same optional fields; passing connectables replaces the whole list, and omitting it keeps the current one. deleteTimeGroup takes an id.

mutation NewTimeGroup($name: String!, $connectables: [TimeGroupConnectableInput!]) {
createTimeGroup(input: { name: $name, connectables: $connectables }) {
timeGroup { id name }
errors { path message }
}
}

A group holds at most 500 connectables, and each one must be visible to you. An unknown or hidden connectable returns a top-level Connectable not found. error.

Use time group IDs with workspaceTimeAllocation, which is limited to workspace admins. Pass timeGroupIds to limit the result to entries in those groups, or groupBy: time_group to aggregate by group; each result row then includes timeGroup { id name }, and entries outside every group have a null timeGroup.