# GraphQL API Details

Each API listed here (with the exception of Query) requires some form of authentication.

In addition to the authentication header, make sure to send the namespace header to designate the intended tenant for your request!

```http
POST /command HTTP/1.1
Authentication: Bearer <api-token>
Content-Type: application/json
Host: graphql.mindfulcms.com
X-Namespace: <org-key>/<workspace-key>

{"query":"mutation { ... }"}
```

{% hint style="info" %}
Only a subset of the available queries, mutations, and fields are documented here. For a real-time view of the current GraphQL schema, issue an [introspection query](https://graphql.org/learn/introspection/) to the API.

If you're using GraphQL Playground or similar client, you can see the available schema and field documentation via the built-in schema browser.
{% endhint %}

#### Analytics

The Analytics API is used to return aggregate or timeseries data collected for known entity kinds. The Analytics API currently uses P1Events as its primary data source. At the moment, metrics are available for the following entity kinds:

* `ADVERTISING_CREATIVE`  (only the `NATIVE_WEBSITE` variant form) and `ADVERTISING_POST`

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/analytics>.

This API supports user, machine, and company token [authentication methods](/mindful-apis/authentication.md).

#### Command

{% hint style="danger" %}
The GraphQL Command API is deprecated and will be removed soon. Please migrate any existing integrations to use the Entity Command API.
{% endhint %}

The Command API is used to make changes to existing data, create new data (as a user) or import data (as an automated process). All changes to Mindful platform data go through the Entity Event Store to ensure consistent processing, history, and attribution -- the Command API is the externally available interface to make those changes. All data models that can be modified in the Mindful platform are available in this API.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/command>.

This API supports user and machine authentication methods.

#### Query

The Query API is used to retrieve data from the Mindful platform -- by id, typeahead/search, or paginated query. All data models that exist in the Mindful platform are available in this API.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/query>.

This API supports user, machine, and company token authentication methods.

#### Subscription

The Subscription API is used to subscribe to events, such as the completion of a document's materialization pipeline, for near-real-time updates in UI applications.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/subscription>.

This API supports user and machine authentication methods.

#### Upload

The upload API is used to upload media (such as images, documents, audio files, etc). Specifically, it allows you to create a signed upload request and finish or cancel it once complete.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/upload>.

This API supports user, machine, and company token authentication methods.

#### User

The User API allows you to log in, log out, and (eventually) manage organization members and API keys.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/user>.

This API supports user and machine authentication methods.

#### Utility

The utility API provides access to miscellaneous functions, such as generate company authentication tokens, parsing HTML, and sending notifications.

To access this API and see details of available fields, send an an introspection request to the API URL: <https://graphql.mindfulcms.com/utility>.

This API supports user, machine, and company token authentication methods.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parameter1.com/mindful-apis/graphql-api-details.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
