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

# createConversionPreset

> Creates a conversion preset at `version` 1 and returns it. The id of a deleted preset creates that preset again, at the version after its last one. Expected failures come back in the payload's `errors` list, not as top-level GraphQL errors, each with a `code` naming the failure: `ConflictError` when a preset with the id exists, and `ValidationError` for an invalid id, display name or parameters. A malformed `aspectRatio` or `background` fails the whole request instead (see `ConversionParametersInput`).



**mutation** `createConversionPreset(input: CreateConversionPresetInput!): CreateConversionPresetPayload!`

## Arguments

**`input`**: `CreateConversionPresetInput!` (required)

## Returns

`CreateConversionPresetPayload!`

**`conversionPreset`**: `ConversionPreset`

---

**`errors`**: `[CreateConversionPresetError!]`

## Examples

```graphql Mutation
mutation CreateConversionPreset($input: CreateConversionPresetInput!) {
  createConversionPreset(input: $input) {
    conversionPreset {
      createdAt
      displayName
      id
      parameters {
        aspectRatio
        background
        mode
        outputFormat
        paddingPercent
        quality
      }
      presetId
      updatedAt
    }
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "displayName": "string",
    "id": "string",
    "parameters": {
      "aspectRatio": "string",
      "mode": "FIT",
      "outputFormat": "JPG",
      "quality": 1,
      "targetSize": 1
    }
  }
}
```

```json Response
{
  "data": {
    "createConversionPreset": {
      "conversionPreset": {
        "createdAt": "value",
        "displayName": "string",
        "id": "id",
        "parameters": {
          "aspectRatio": "string",
          "background": "string",
          "mode": "FIT",
          "outputFormat": "JPG",
          "paddingPercent": 1,
          "quality": 1
        },
        "presetId": "string",
        "updatedAt": "value"
      },
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ]
    }
  }
}
```


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