Convex
App · 15 actions
Work with your Convex backend: run your app's queries, mutations and actions, read tables and documents, manage environment variables, check usage and the audit log, pause or resume the deployment, and start workflows when documents are added, changed or deleted.
Actions
| Action | What it does |
|---|---|
| Count documents | Count the documents in a table. |
| Delete environment variable | Remove an environment variable from your deployment. |
| Get deployment info | Get which deployment this is (production, development or preview), its project, and the addresses its functions and HTTP actions are served at. |
| Get usage | Get how much the deployment has used today and this month: function calls, database and file bandwidth, compute and more. |
| List audit log events | List changes made to the deployment, oldest first: code pushed, environment variables changed, data edited in the dashboard and more, with who made each. |
| List documents | List a table's documents, newest first unless you choose oldest first. |
| List environment variables | List your deployment's environment variables (the settings your functions read with process.env) and their values. |
| List functions | List the queries, mutations and actions deployed in your app, with the arguments each takes and whether it is public or internal. |
| List tables | List the tables in your deployment's database. |
| Pause deployment | Stop the deployment running any functions, including scheduled ones and cron jobs, until it is resumed. |
| Resume deployment | Let a paused deployment run functions again; scheduled functions that waited run now. |
| Run action | Run one of your app's action functions with arguments, such as one that calls another service, and return what it returns. |
| Run mutation | Run one of your app's mutation functions with arguments, such as one that adds or changes documents, and return what it returns. |
| Run query | Run one of your app's query functions with arguments and return what it returns. |
| Set environment variable | Add an environment variable to your deployment, or change its value. |
Count documents
Count the documents in a table.
Inputs
- Table
tabletextRequired - The table. Pick one, or type its name.
Outputs
countnumber- How many documents it holds
tabletext- The table counted
Example output
{
"count": 42,
"table": "tasks"
}Delete environment variable
Remove an environment variable from your deployment.
Inputs
- Name
nametextRequired - The environment variable's name. Pick one, or type it.
Outputs
deletedtrue/false- False if there was no such variable
nametext- The variable's name
Example output
{
"deleted": true,
"name": "SITE_URL"
}Get deployment info
Get which deployment this is (production, development or preview), its project, and the addresses its functions and HTTP actions are served at.
Inputs
None.
Outputs
deployment_idnumber- The deployment's id
deployment_typetext- prod, dev, preview or custom
deployment_urltext- Where its functions are served
http_actions_urltext- Where its HTTP actions are served
kindtext- cloud or self_hosted
project_idnumber- The project's id
project_nametext- The project's name
project_slugtext- The project's slug
referencetext- The deployment's reference, if it has one
team_idnumber- The team's id
Example output
{
"deployment_id": 12345,
"deployment_type": "prod",
"deployment_url": "https://happy-otter-123.convex.cloud",
"http_actions_url": "https://happy-otter-123.convex.site",
"kind": "cloud",
"project_id": 678,
"project_name": "My app",
"project_slug": "my-app",
"reference": null,
"team_id": 90
}Get usage
Get how much the deployment has used today and this month: function calls, database and file bandwidth, compute and more.
Inputs
None.
Outputs
completetrue/false- False while Convex is still adding up the period, so the numbers may be low
countnumber- How many
metricslist- Each metric
Example output
{
"complete": true,
"count": 1,
"metrics": [
{
"metric": "functionCalls",
"this_month": 35000,
"today": 1200,
"unit": "calls"
}
]
}List audit log events
List changes made to the deployment, oldest first: code pushed, environment variables changed, data edited in the dashboard and more, with who made each. Needs a Convex Pro plan.
Inputs
- Since
sincedate and time - Only changes made at or after this time. Defaults to the last 24 hours.
- Page size
limitnumber - How many to return, 1 to 100. Defaults to 100.From 1 to 100.
- Next page cursor
cursortext - The 'next_cursor' from an earlier page, with the same Since, to get the page after it.
Outputs
countnumber- How many
eventslist- The changes
has_moretrue/false- True if there are more
next_cursortext- Give this as Next page cursor for more; empty at the end
Example output
{
"count": 1,
"events": [
{
"action": "update_environment_variable",
"actor": "member 1234",
"client_ip": null,
"created_at": "2026-10-30T09:00:00.000Z",
"metadata": {
"variable_name": "SITE_URL"
}
}
],
"has_more": false,
"next_cursor": ""
}List documents
List a table's documents, newest first unless you choose oldest first. Returns one page; pass 'next_cursor' as Next page cursor for more.
Inputs
- Table
tabletextRequired - The table. Pick one, or type its name.
- Order
ordertext - By when each document was created.One of:
desc(Newest first (default)),asc(Oldest first). Default:desc. - Page size
limitnumber - How many documents to return, 1 to 1,000. Defaults to 100.From 1 to 1000.
- Next page cursor
cursortext - The 'next_cursor' from an earlier page, to get the page after it.
Outputs
countnumber- How many documents are on this page
documentslist- The documents, with all their fields
is_donetrue/false- True when there are no more documents
next_cursortext- Give this as Next page cursor for the next page; empty at the end
tabletext- The table read
Example output
{
"count": 1,
"documents": [
{
"_creationTime": 1793594393943.69,
"_id": "j57739me76acsgqhajbt73mb2h8hfwre"
}
],
"is_done": true,
"next_cursor": "",
"table": "tasks"
}List environment variables
List your deployment's environment variables (the settings your functions read with process.env) and their values.
Inputs
None.
Outputs
countnumber- How many
variableslist- The variables, by name
Example output
{
"count": 1,
"variables": [
{
"name": "SITE_URL",
"value": "https://example.com"
}
]
}List functions
List the queries, mutations and actions deployed in your app, with the arguments each takes and whether it is public or internal.
Inputs
- Kind
function_typetext - Only functions of this kind. Leave empty for all.One of:
query(Queries),mutation(Mutations),action(Actions).
Outputs
countnumber- How many
functionslist- The functions
Example output
{
"count": 1,
"functions": [
{
"arguments": [
{
"name": "text",
"optional": false,
"type": "string"
}
],
"name": "tasks:add",
"required_arguments": [
"text"
],
"type": "mutation",
"visibility": "public"
}
]
}List tables
List the tables in your deployment's database.
Inputs
None.
Outputs
countnumber- How many
tableslist- The tables
Example output
{
"count": 1,
"tables": [
{
"name": "tasks"
}
]
}Pause deployment
Stop the deployment running any functions, including scheduled ones and cron jobs, until it is resumed. No data is lost; calls to it fail while it is paused.
Inputs
None.
Outputs
pausedtrue/false- Always true
Example output
{
"paused": true
}Resume deployment
Let a paused deployment run functions again; scheduled functions that waited run now. Nothing changes if it isn't paused.
Inputs
None.
Outputs
pausedtrue/false- Always false
was_pausedtrue/false- False if it was already running
Example output
{
"paused": false,
"was_paused": true
}Run action
Run one of your app's action functions with arguments, such as one that calls another service, and return what it returns. An action can run for up to ten minutes.
Inputs
- Action
functiontextRequired - The action to run. Pick one, or type its name as your code names it, such as emails:send.
- Arguments
argumentsobject - The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.
Outputs
functiontext- The function that ran, such as tasks:list
log_lineslist- What the function logged with console.log
valueobject- What the function returned: any value, list or object
Example output
{
"function": "emails:send",
"log_lines": [],
"value": {
"sent": true
}
}Run mutation
Run one of your app's mutation functions with arguments, such as one that adds or changes documents, and return what it returns.
Inputs
- Mutation
functiontextRequired - The mutation to run. Pick one, or type its name as your code names it, such as tasks:add.
- Arguments
argumentsobject - The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.
Outputs
functiontext- The function that ran, such as tasks:list
log_lineslist- What the function logged with console.log
valueobject- What the function returned: any value, list or object
Example output
{
"function": "tasks:add",
"log_lines": [],
"value": "j57739me76acsgqhajbt73mb2h8hfwre"
}Run query
Run one of your app's query functions with arguments and return what it returns. Queries only read data.
Inputs
- Query
functiontextRequired - The query to run. Pick one, or type its name as your code names it, such as tasks:list.
- Arguments
argumentsobject - The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.
Outputs
functiontext- The function that ran, such as tasks:list
log_lineslist- What the function logged with console.log
valueobject- What the function returned: any value, list or object
Example output
{
"function": "tasks:list",
"log_lines": [],
"value": [
{
"_creationTime": 1793594393943.69,
"_id": "j57739me76acsgqhajbt73mb2h8hfwre"
}
]
}Set environment variable
Add an environment variable to your deployment, or change its value. Your functions see the new value straight away.
Inputs
- Name
nametextRequired - The variable's name: letters, digits and underscores, starting with a letter, such as SITE_URL.
- Value
valuetextRequired - The value to give it.
Outputs
createdtrue/false- True if it is new, false if it changed
nametext- The variable's name
valuetext- Its value now
Example output
{
"created": true,
"name": "SITE_URL",
"value": "https://example.com"
}