---
title: "Execute a v10 transaction"
method: POST
path: "/query/1"
tags: ["query"]
---

# Execute a v10 transaction

`POST /query/1`

???

## Headers

- `x-format` 'simple' | 'tagged' | 'decorated' — A format specifier for the arguments and response of the query
- `x-last-txn-ts` integer
- `x-typecheck` boolean
- `x-linearized` boolean
- `x-performance-hints` boolean
- `x-query-timeout-ms` integer
- `x-max-contention-retries` integer
- `x-query-tags` string

## Request body

- Query
  - `query` union, required — The FQL transaction to be executed
    - string
    - union — An interpolated query, designed to be output by javascript template strings or similar language features. This schema allows clients to output well-formed JSON and rely on the service to validate the structure of the query itself, separating the query expression from values, and eliminating security issues such as injection attacks.
      - object
        - `fql` union[], required
          - union
            - string
            - QueryInterpolation — recursive
      - object
        - `value` union, required — A value when the `format` is set to `tagged`.
          - object — A 32-bit signed integer
            - `@int` string, required
          - object — A 64-bit signed integer
            - `@long` string, required
          - object — A 64-bit double
            - `@double` string, required
          - string — A string
          - TaggedValue[] — An array of values
          - object — An object. Properties with a name starting with `@` are not allowed as raw objects. See the `@object` tag for encoding rules on objects with `@` names.
          - object — An object. Explicitly tagged objects are allowed to have property names starting with `@`. If an FQL object value contains properties starting with `@`, it will be emitted on the wire in an `@object` tag.
            - `@object` object, required
          - object — A module (Math, Time, etc)
            - `@mod` string, required
          - object — A date (ex. 1970-01-01)
            - `@date` string, required
          - object — A time (ex. 1970-01-01T00:00:00+0000)
            - `@time` string, required
          - object — A document. This document existed when the query was executed, and was successfully read. One and only one of the `id` or `name` fields will be present, depending on if the reference points to a named value or not. For example, roles have a name, so they will have the `name` field, and no `id` field.
            - `@doc` object, required
              - …
          - object — A document that wasn't read by core. It may be deleted. One and only one of the `id` or `name` fields will be present, depending on if the reference points to a named value or not. For example, roles have a name, so they will have the `name` field, and no `id` field. When there is an `exists` field this can be used to determine if the ref points to a document that can be read. If this field is set to false, there will also be a corresponding `cause` field indicating the reason that the document cannot be read. The current set of possible reasons are: 1. not found 2. permission denied If the exists field is not present, then the document may or may not exist.
            - `@ref` object, required
              - …
          - object — A set page. The `after` field is a string, which is a cursor that can be used to fetch the next page, by passing it to `Set.paginate()`.
            - `@set` object, required
              - …
      - object
        - `array` QueryInterpolation[], required
      - object
        - `object` object, required
  - `arguments` object — An object containing values provided to the submitted transaction as variables. Note that variable names must be valid FQL identifiers.

## Response `200`

Successful operation

- QuerySuccess
  - `data` union, required — A value in either the query arguments or response body. The format is determined by the `x-format` header.
    - unknown
    - union — A value when the `format` is set to `tagged`.
      - object — A 32-bit signed integer
        - `@int` string, required
      - object — A 64-bit signed integer
        - `@long` string, required
      - object — A 64-bit double
        - `@double` string, required
      - string — A string
      - TaggedValue[] — An array of values
      - object — An object. Properties with a name starting with `@` are not allowed as raw objects. See the `@object` tag for encoding rules on objects with `@` names.
      - object — An object. Explicitly tagged objects are allowed to have property names starting with `@`. If an FQL object value contains properties starting with `@`, it will be emitted on the wire in an `@object` tag.
        - `@object` object, required
      - object — A module (Math, Time, etc)
        - `@mod` string, required
      - object — A date (ex. 1970-01-01)
        - `@date` string, required
      - object — A time (ex. 1970-01-01T00:00:00+0000)
        - `@time` string, required
      - object — A document. This document existed when the query was executed, and was successfully read. One and only one of the `id` or `name` fields will be present, depending on if the reference points to a named value or not. For example, roles have a name, so they will have the `name` field, and no `id` field.
        - `@doc` object, required
          - `id` string
          - `name` string
          - `ts` TaggedValue, required — recursive
          - `coll` TaggedValue, required — recursive
      - object — A document that wasn't read by core. It may be deleted. One and only one of the `id` or `name` fields will be present, depending on if the reference points to a named value or not. For example, roles have a name, so they will have the `name` field, and no `id` field. When there is an `exists` field this can be used to determine if the ref points to a document that can be read. If this field is set to false, there will also be a corresponding `cause` field indicating the reason that the document cannot be read. The current set of possible reasons are: 1. not found 2. permission denied If the exists field is not present, then the document may or may not exist.
        - `@ref` object, required
          - `id` string
          - `name` string
          - `coll` TaggedValue, required — recursive
          - `exists` boolean, nullable
          - `cause` string, nullable
      - object — A set page. The `after` field is a string, which is a cursor that can be used to fetch the next page, by passing it to `Set.paginate()`.
        - `@set` object, required
          - `data` TaggedValue[], required
          - `after` string
  - `static_type` string — The query's inferred static result type, if the query was typechecked.
  - `txn_ts` integer — The transaction commit time in micros since epoch. Used by drivers to populate the x-last-txn-ts request header in order to get a consistent prefix RYOW guarantee.
  - `schema_version` integer — The schema version used by the query. This can be used by clients displaying schema to determine when they should refresh their schema. If the schema version that a client has stored differs from the one returned by the query, schema should be refreshed.
  - `summary` string — A comprehensive, human readable summary of any errors, warnings and/or logs returned from the query.
  - `query_tags` unknown
  - `stats` object — Query stats
    - `compute_ops` integer — The amount of Transactional Compute Ops consumed by the query.
    - `read_ops` integer — The amount of Transactional Read Ops consumed by the query.
    - `write_ops` integer — The amount of Transactional Write Ops consumed by the query.
    - `query_time_ms` integer — The query run time in milliseconds.
    - `storage_bytes_read` integer — The amount of data read from storage, in bytes.
    - `storage_bytes_write` integer — The amount of data written to storage, in bytes.
    - `contention_retries` integer — The number of times the transaction was retried due to write contention.
    - `rate_limits_hit` string[] — Operations that exceeded their set rate limit.

## Other responses

- `400` — Failed operation (bad request)
- `401` — Fauna is unable to authenticate the request due to an invalid or missing authentication token.
- `409` — Too much contention occurred on a document while executing a query.
- `429` — The query exceeded some capacity limit
- `440` — The client specified timeout was exceeded, but the timeout was set lower than the query's expected processing time. This response is distinguished from 503 by the fact that a 440 response is considered a successful response for the purpose of determining the service's availability.
- `500` — An unexpected error occurred
- `502` — The router could not reach the backend
- `503` — An unexpected timeout occurred
- `504` — The router timed out trying to connect to the backend

---

[API](https://skmtc.dev/fauna/apis/fql-v10-request-response-api.md) · [All operations](https://skmtc.dev/fauna/apis/fql-v10-request-response-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fauna/fql-v10-request-response-api/revisions/1b2b60114118/schema)
