> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create account project

> Create and assign a project atomically.

export const GraphQLOperationPlayground = ({operationName, query, variables, operationType = 'query'}) => {
  const endpoint = 'https://api.veryfront.com/graphql';
  const tokenStorageKey = 'veryfront.docs.mcpBearerToken';
  const readStoredToken = () => {
    if (typeof window === 'undefined') return '';
    try {
      return window.sessionStorage.getItem(tokenStorageKey) || '';
    } catch {
      return '';
    }
  };
  const [token, setToken] = useState(readStoredToken);
  const [queryText, setQueryText] = useState(query);
  const [variablesText, setVariablesText] = useState(variables);
  const [running, setRunning] = useState(false);
  const [status, setStatus] = useState('');
  const [response, setResponse] = useState(null);
  const [copied, setCopied] = useState(false);
  const updateToken = value => {
    setToken(value);
    try {
      if (value) window.sessionStorage.setItem(tokenStorageKey, value); else window.sessionStorage.removeItem(tokenStorageKey);
    } catch {}
  };
  const runOperation = async () => {
    let parsedVariables;
    try {
      parsedVariables = variablesText.trim() ? JSON.parse(variablesText) : {};
    } catch {
      setStatus('Variables must be valid JSON.');
      return;
    }
    if (parsedVariables === null || Array.isArray(parsedVariables) || typeof parsedVariables !== 'object') {
      setStatus('Variables must be a JSON object.');
      return;
    }
    setRunning(true);
    setStatus('Sending request…');
    setCopied(false);
    setResponse(null);
    try {
      const result = await fetch(endpoint, {
        method: 'POST',
        headers: {
          accept: 'application/json',
          'content-type': 'application/json',
          ...token.trim() ? {
            authorization: `Bearer ${token.trim()}`
          } : {},
          'x-veryfront-origin': 'docs-graphql-operation-page'
        },
        body: JSON.stringify({
          operationName,
          query: queryText,
          variables: parsedVariables
        })
      });
      const text = await result.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {}
      setResponse(body === undefined ? text || 'No response body.' : JSON.stringify(body, null, 2));
      setStatus(!result.ok ? `Request failed with HTTP ${result.status}.` : body?.errors?.length ? 'The response contains GraphQL errors.' : 'Response received.');
    } catch (error) {
      setStatus('Request failed.');
      setResponse(error instanceof Error ? error.message : String(error));
    } finally {
      setRunning(false);
    }
  };
  const copyResponse = async () => {
    try {
      await navigator.clipboard.writeText(response || '');
      setCopied(true);
    } catch {
      setStatus('Could not copy the response.');
    }
  };
  return <details className="api-try-operation not-prose">
    <summary>Try this {operationType}</summary>
    <p>Calls use <code>{endpoint}</code>. Replace sample values with resources you can access. See <a href="/docs/cloud/authentication">Authentication</a> for credentials and permissions.</p>
    <div className="api-request-playground not-prose">
      <label htmlFor={`${operationName}-token`}>Bearer token or API key</label>
      <input id={`${operationName}-token`} type="password" value={token} onChange={event => updateToken(event.target.value)} placeholder="Paste a credential to authenticate" autoComplete="off" />
      <div className="api-request-help">Stored in this tab's session. <button type="button" onClick={() => updateToken('')}>Clear credential</button></div>

      <label htmlFor={`${operationName}-query`}>{operationType === 'mutation' ? 'Mutation' : 'Query'}</label>
      <textarea id={`${operationName}-query`} value={queryText} onChange={event => setQueryText(event.target.value)} rows={12} spellCheck={false} />
      <label htmlFor={`${operationName}-variables`}>Variables (JSON)</label>
      <textarea id={`${operationName}-variables`} value={variablesText} onChange={event => setVariablesText(event.target.value)} rows={3} spellCheck={false} />
      <button className="api-request-submit" type="button" disabled={running} onClick={runOperation}>
        {running ? 'Running…' : operationType === 'mutation' ? 'Run mutation' : 'Run query'}
      </button>
      <p className="api-request-status" role="status" aria-live="polite">{status}</p>
      {response !== null && <div className="api-request-response">
        <div className="api-request-response-heading"><span>Response</span><button type="button" onClick={copyResponse}>{copied ? 'Copied' : 'Copy'}</button></div>
        <pre><code>{response}</code></pre>
      </div>}
    </div>
    </details>;
};

<div className="api-operation-signature">
  `createAccountProject(input: CreateAccountProjectInput!): AccountProject!`
</div>

Requires account.projects.create.

Caller remains billing and seat owner.

Duplicate slug is 409; caller project limit is 402.

Explicit-slug retries conflict rather than replay.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`CreateAccountProjectInput!`](/docs/cloud/graphql/types/createaccountprojectinput) | Yes |

## Input fields

### input

[`CreateAccountProjectInput`](/docs/cloud/graphql/types/createaccountprojectinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `accountId` | [`UUID!`](/docs/cloud/graphql/types/uuid) | Yes | Account UUID. Requires account.projects.create. |
| `name` | [`String!`](/docs/cloud/graphql/types/string) | Yes | Project display name. |
| `slug` | [`String`](/docs/cloud/graphql/types/string) | No | Unique project slug. Omit or pass null to generate a random suffix. |
| `templateSlug` | [`String`](/docs/cloud/graphql/types/string) | No | Optional template slug. A template project UUID takes precedence. Null means omitted. |
| `templateProjectId` | [`UUID`](/docs/cloud/graphql/types/uuid) | No | Optional template project UUID. Overrides templateSlug. Null means omitted. |

## Response

Returns [`AccountProject!`](/docs/cloud/graphql/types/accountproject). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `id` | [`ID!`](/docs/cloud/graphql/types/id) | Project UUID. |
| `slug` | [`String!`](/docs/cloud/graphql/types/string) | Project slug. |
| `name` | [`String!`](/docs/cloud/graphql/types/string) | Project display name. |
| `accountId` | [`UUID!`](/docs/cloud/graphql/types/uuid) | Account UUID to which this project is assigned. |
| `type` | [`AccountProjectType!`](/docs/cloud/graphql/types/accountprojecttype) | Project classification. |
| `isTemplate` | [`Boolean!`](/docs/cloud/graphql/types/boolean) | Whether the project is available as a template. |
| `systemManaged` | [`Boolean!`](/docs/cloud/graphql/types/boolean) | Whether the platform manages this project. |
| `createdAt` | [`String!`](/docs/cloud/graphql/types/string) | Project creation timestamp in ISO 8601 UTC. |

[All fields of `AccountProject`](/docs/cloud/graphql/types/accountproject).

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](/docs/cloud/graphql/schema) lists all published input and response types.

## Example

<CodeGroup>
  ```graphql title="query.graphql" theme={null}
  mutation CreateAccountProject($input: CreateAccountProjectInput!) {
    createAccountProject(input: $input) {
      id
      name
      slug
      createdAt
      updatedAt
    }
  }
  ```

  ```json title="variables.json" theme={null}
  {
    "input": {
      "accountId": "example",
      "name": "example"
    }
  }
  ```
</CodeGroup>

<GraphQLOperationPlayground operationName="CreateAccountProject" operationType="mutation" query={"mutation CreateAccountProject($input: CreateAccountProjectInput!) {\n  createAccountProject(input: $input) {\n    id\n    name\n    slug\n    createdAt\n    updatedAt\n  }\n}"} variables={"{\n  \"input\": {\n    \"accountId\": \"example\",\n    \"name\": \"example\"\n  }\n}"} />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.