API Documentation
Overview
This API provides functionalities for user authentication and codon usage optimization. Some endpoints require authentication using an access token obtained after login.
Endpoints
1. API Status (/)
Method: GET
Description: Returns the status of the API, indicating whether the service is running.
Authentication: ❌ Not required
Response Example:
Output Parameters
build: The SHA-1 hash defining the version build of the API.environment: The environment of the APIfirebase: The status of the internal database
2. User Login (/login)
Method: POST
Description: Authenticates the user and returns an access token. The access token is valid for 60 minutes. Then it needs to be regenerated.
Authentication: ❌ Not required
Query Parameters:
username(string, required): Usernamepassword(string, required): User password
Response Example:
Output Parameters
- token: The access token to be used for querying the API when authentication is required.
3. Sequence optimization (/optimise)
Method: POST
Description:
This endpoint creates a new sequence optimisation job to be added to the queue. The API will process the job as soon as a worker is avaiable. It requires authentication via a bearer token. You must provide both the sequence and a unique name identifier, together with a list of fitnesses to be used for the optimization process. Each fitness might require a specific set of parameters that needs to be provided in this API call. Additionally, you may include the optional parameters start and end to specify the coding sequence region. If these parameters are not provided, the entire sequence is used by default. The method returns a job identificator than can be used to check the job status and to retrieve the results. Each fitness accept an additional parameter weigth that specifies the relative importance of each fitness. If no weight is provided, 1.0 is assumed.
Authentication: ✅ Required
Headers:
- Authorization: Bearer <access_token>
Output Parameters
sequence: The coding sequence to optimise.5_utr: The 5'UTR sequence associated to the coding sequence3_utr: The 3'UTR sequence associated to the coding sequencename:fitness_list: A list of fitnesses to be used for the optimization. Fitness parameters are individually defined in the fitness page
Request Body (JSON):
{
"sequence": "ATGCGTACGTA",
"5_utr": "GGATCGAT",
"3_utr": "AAAAAAAA",
"name": "sequence_id",
"fitness_list": [
{
"name": "rna_manufact",
"weight": 1.0
},
{
"name": "gc_content",
"min": 35.0,
"max": 60.0,
"weight": 1.0
},
{
"name": "te_ribonn",
"tissue": "HEK293T",
"weight": 1.0
}
]
}
Response Example:
{
"name": "sequence_id",
"sequence": "ATGCTAGCTAGC",
"jobid": "123e4567-e89b-12d3-a456-426614174000"
}
Output Parameters
name: The unique identifier for the sequence, used for tracking and reporting purposes.sequence: The nucleotide sequence that was analyzed.jobid: The uuid representing the submitted job.
4. Job status (/optimise/status)
Method: POST
Description: Returns the status of one or more submitted jobs.
Authentication: ✅ Required
Headers:
- Authorization: Bearer <access_token>
Request Body (JSON):
Notes
jobidsmust be an array- Minimum length: 1
- Each element must be a valid UUID
Response Example:
{
"results": [
{
"jobid": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending"
},
{
"jobid": "987e6543-e21b-45d3-b789-123456789abc",
"status": "running"
}
]
}
Output Parameters
- results: Array of job status objects
jobid: The uuid representing the submitted job.status: The job status. It can be one of the following:pending,running,error,success
5. Job result (/optimise/result)
Method: POST
Description: Returns the result of a given optimisation job.
Authentication: ✅ Required
Headers:
- Authorization: Bearer <access_token>
Request Body (JSON):
Response Example:
{
"jobid": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"sequence": "ATGCTAGCTAGC",
"optimised": "ATCCTTGCTAGC",
"score": 13.6,
"fitness_list": [
{
"name": "rna_manufact",
"weight": 1.0,
"score": 1.24
},
{
"name": "gc_content",
"weight": 1.0,
"score": 1.0
},
{
"name": "te_ribonn",
"weight": 1.0,
"score": 5.0
}
]
}
Output Parameters
jobid: The uuid representing the submitted job.status: The job status. It can be one of the following:pending,running,error,success.sequence: The input sequenceoptimised: The optimised sequencescore: The overall score of the optimised sequence, accounting for all fitnesses.fitness_list: The input list of fitnesses with the weight and the individual score.
Endpoint Summary
| Endpoint | Method | Public | Description |
|---|---|---|---|
/ |
GET |
✅ | API status check |
/login |
POST |
✅ | Authenticate and obtain an access token |
/optimise |
POST |
❌ | Predict sequence manufacturability |
/optimise/status |
POST |
❌ | Check job status |
/optimise/result |
POST |
❌ | Returns optimization result |
Authentication
- Endpoints marked as private require authentication.
- Use the
/loginendpoint to obtain an access token. - Include the token in the
Authorizationheader of your requests:
This documentation is automatically updated with every repository commit via GitHub Actions.