---
title: "Create a consensus nucleotide alignment"
method: POST
path: "/api/v3/nucleotide-alignment:create-consensus-alignment"
tags: ["Nucleotide Alignment"]
---

# Create a consensus nucleotide alignment

`POST /api/v3/nucleotide-alignment:create-consensus-alignment`

## Request

- Base URL: `https://{tenant_name}.benchling.com`
- URL: `https://{tenant_name}.benchling.com/api/v3/nucleotide-alignment:create-consensus-alignment`
- Auth: HTTP bearer

Create a consensus nucleotide alignment

## Request body

- CreateConsensusAlignmentInput
  - `algorithm` 'MAFFT' | 'CLUSTALO', required: Multiple sequence alignment algorithm to use.
  - `clustaloOptions` ClustalOOptionsInput
    - `maxGuidetreeIterations` integer: Max guide tree iterations within combined iterations. Can be in the range -1 to 5 (-1 = no max).
    - `maxHmmIterations` integer: Max HMM iterations within combined iterations. Can be in the range -1 to 5 (-1 = no max).
    - `mbedGuideTree` boolean: Whether mBed-like clustering guide tree should be used (faster to use it).
    - `mbedIteration` boolean: Whether mBed-like clustering iteration should be used (faster to use it).
    - `numCombinedIterations` integer: Number of (combined guide-tree/HMM) iterations. Can be in the range 0 to 5.
  - `files` AlignmentFileInput[], required: Sequence files to align. Minimum 2, maximum 250.
    - `data` string: Base64-encoded file content for the sequence to align. Required when providing name instead of sequenceId.
    - `name` string: File name for a raw sequence file (for example, an .ab1 trace file). Required when providing data instead of sequenceId.
    - `sequenceId` string: API ID of an existing NucleotideSequence to align. Mutually exclusive with name and data.
  - `mafftOptions` MafftOptionsInput
    - `adjustDirection` 'FAST' | 'ACCURATE' | 'DISABLED': Controls whether and how MAFFT auto-detects reverse-complement sequences.
    - `gapExtensionPenalty` number, double: Gap extension penalty.
    - `gapOpenPenalty` number, double: Gap open penalty.
    - `maxIterations` integer: Max refinement iterations. Can be in the range 0 to 100. Not applicable for auto strategy, as it will be selected automatically.
    - `retree` integer: Tree rebuilding. Only used for 6-mer strategy.
    - `strategy` 'AUTO' | 'SIXMER' | 'LOCALPAIR' | 'GLOBALPAIR': MAFFT strategy preset.
  - `name` string: The name of the alignment. When omitted, a name is automatically generated. If specified, it must contain at least one non-whitespace character. Up to 255 characters.
  - `newSequence` NewSequenceInput
    - `folderId` string, required: API ID of the folder in which to create the new NucleotideSequence.
  - `sequenceId` string: API ID of an existing empty NucleotideSequence to overwrite with the consensus alignment result. The target sequence must have no bases; requests fail with 'Sequence must be empty' otherwise. Mutually exclusive with newSequence.

## Response `202`

Task started

- AsyncTaskLink
  - `pollingUri` string, uri
  - `taskId` string

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/benchling/apis/benchling-api.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api/revisions/c9f087b98b8b?raw)
