openapi: 3.1.0
info:
title: API Reference subpackage_actions subpackage_projects.subpackage_projects/metrics.subpackage_projects/metrics/custom API
version: 1.0.0
servers:
- url: http://localhost:8000
tags:
- name: subpackage_projects.subpackage_projects/metrics.subpackage_projects/metrics/custom
paths:
/api/projects/{id}/aws-custom-function:
get:
operationId: get-lambda
summary: ✨ Get AWS custom metric code
description: " \n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n \n
curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Lambda code and deployment status
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_get_lambda_Response_200'
post:
operationId: update-lambda
summary: ✨ Update AWS custom metric Lambda
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_update_lambda_Response_200'
'500':
description: Error updating function
content:
application/json:
schema:
description: Any type
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AWSCustomFunctionUpdateRequest'
/api/projects/{id}/aws-custom-function-logs:
get:
operationId: logs
summary: ✨ Get AWS lambda logs for project
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Successful response returns list of AWS lambda logs
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_logs_Response_200'
/api/projects/{id}/check-function:
post:
operationId: check-function
summary: ✨ Check custom matching function code
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Code is valid
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_check_function_Response_200'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CheckMatchingFunctionRequestRequest'
/api/projects/{id}/custom-function:
get:
operationId: get-function
summary: ✨ Get custom metric code
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Function code and deployment status
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_get_function_Response_200'
post:
operationId: deploy-function
summary: ✨ Deploy custom metric function
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_deploy_function_Response_200'
'500':
description: Error updating function
content:
application/json:
schema:
description: Any type
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CustomFunctionCodeRequestRequest'
/api/projects/{id}/custom-function-logs:
get:
operationId: get-function-logs
summary: ✨ Get custom metric function logs
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: List of function execution logs
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_get_function_logs_Response_200'
/api/projects/{id}/gcp-custom-function:
get:
operationId: get-gcp-function
summary: ✨ Get GCP custom metric code
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Cloud Function code and deployment status
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_get_gcp_function_Response_200'
post:
operationId: update-gcp-function
summary: ✨ Update GCP custom metric Cloud Function
description: "\n This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n
\ncurl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'
required: true
schema:
type: string
responses:
'200':
description: Updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/projects_metrics_custom_update_gcp_function_Response_200'
'500':
description: Error updating function
content:
application/json:
schema:
description: Any type
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GCPCustomFunctionUpdateRequest'
components:
schemas:
ApiProjectsIdCustomFunctionGetResponsesContentApplicationJsonSchemaStatus:
type: string
enum:
- NotDeployed
- Active
- Pending
- Failed
- NotFound
- Error
title: ApiProjectsIdCustomFunctionGetResponsesContentApplicationJsonSchemaStatus
GCPCustomFunctionUpdateRequest:
type: object
properties:
code:
type: string
description: The Python code for the custom metric function.
project:
type:
- string
- 'null'
description: The GCP project ID. Uses default if not provided.
region:
type:
- string
- 'null'
description: The GCP region for the Cloud Function. Uses default if not provided.
required:
- code
description: Serializer for updating GCP Cloud Function custom metric.
title: GCPCustomFunctionUpdateRequest
projects_metrics_custom_deploy_function_Response_200:
type: object
properties: {}
description: Empty response body
title: projects_metrics_custom_deploy_function_Response_200
AWSCustomFunctionUpdateRequest:
type: object
properties:
code:
type: string
description: The Python code for the custom metric function.
region:
type:
- string
- 'null'
description: The AWS region for the Lambda function. Uses default if not provided.
role:
type:
- string
- 'null'
description: The AWS IAM role ARN for the Lambda function. Uses default if not provided.
required:
- code
description: Serializer for updating AWS Lambda custom metric function.
title: AWSCustomFunctionUpdateRequest
projects_metrics_custom_update_gcp_function_Response_200:
type: object
properties: {}
description: Empty response body
title: projects_metrics_custom_update_gcp_function_Response_200
projects_metrics_custom_get_function_logs_Response_200:
type: object
properties: {}
title: projects_metrics_custom_get_function_logs_Response_200
projects_metrics_custom_logs_Response_200:
type: object
properties: {}
description: List of AWS lambda logs
title: projects_metrics_custom_logs_Response_200
ApiProjectsIdAwsCustomFunctionGetResponsesContentApplicationJsonSchemaStatus:
type: string
enum:
- NotDeployed
- Active
- Pending
- Inactive
- Failed
- NotFound
- Error
description: Deployment status of the Lambda function.
title: ApiProjectsIdAwsCustomFunctionGetResponsesContentApplicationJsonSchemaStatus
projects_metrics_custom_check_function_Response_200:
type: object
properties: {}
description: Empty response body
title: projects_metrics_custom_check_function_Response_200
CustomFunctionCodeRequestRequest:
type: object
properties:
code:
type: string
required:
- code
title: CustomFunctionCodeRequestRequest
projects_metrics_custom_get_function_Response_200:
type: object
properties:
code:
type: string
status:
$ref: '#/components/schemas/ApiProjectsIdCustomFunctionGetResponsesContentApplicationJsonSchemaStatus'
required:
- code
- status
title: projects_metrics_custom_get_function_Response_200
CheckMatchingFunctionRequestRequest:
type: object
properties:
code:
type: string
required:
- code
title: CheckMatchingFunctionRequestRequest
ApiProjectsIdGcpCustomFunctionGetResponsesContentApplicationJsonSchemaStatus:
type: string
enum:
- NotDeployed
- Active
- Pending
- Failed
- NotFound
- Error
title: ApiProjectsIdGcpCustomFunctionGetResponsesContentApplicationJsonSchemaStatus
projects_metrics_custom_update_lambda_Response_200:
type: object
properties: {}
description: Empty response body
title: projects_metrics_custom_update_lambda_Response_200
projects_metrics_custom_get_lambda_Response_200:
type: object
properties:
code:
type: string
status:
$ref: '#/components/schemas/ApiProjectsIdAwsCustomFunctionGetResponsesContentApplicationJsonSchemaStatus'
description: Deployment status of the Lambda function.
required:
- code
- status
title: projects_metrics_custom_get_lambda_Response_200
projects_metrics_custom_get_gcp_function_Response_200:
type: object
properties:
code:
type: string
status:
$ref: '#/components/schemas/ApiProjectsIdGcpCustomFunctionGetResponsesContentApplicationJsonSchemaStatus'
required:
- code
- status
title: projects_metrics_custom_get_gcp_function_Response_200
securitySchemes:
Token:
type: apiKey
in: header
name: Authorization
description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"'