This API allows managing usage limits for both projects and organizations, providing functionality to define, retrieve, update, and delete usage limits.
To use the API, check the generic variables needed.
In addition, read the explanation about usage limits in Organization Usage Limits and Managing quotas per project.
Method |
Path |
Description |
POST |
/usageLimits/organizations/{organization}/limits |
Defines a new usage limit for an organization |
GET |
/usageLimits/organizations/{organization}/limits/latest |
Retrieves the latest usage limit defined for the organization |
GET |
/usageLimits/organizations/{organization}/limits |
Retrieves all usage limits defined for the organization |
DELETE |
/usageLimits/organizations/{organization}/limits/{id} |
Deletes a usage limit for the organization |
PUT |
/usageLimits/organizations/{organization}/limits/{id}/hardLimit |
Modifies the hardLimit of an active usage limit for the organization |
PUT |
/usageLimits/organizations/{organization}/limits/{id}/softLimit |
Modifies the softLimit of an active usage limit for the organization |
PUT |
/usageLimits/organizations/{organization}/limits/{id}/renewalStatus |
Modifies the renewalStatus of an active usage limit for the organization |
POST |
/usageLimits/organizations/{organization}/projects/{project}/limits |
Defines a new usage limit for a project |
GET |
/usageLimits/organizations/{organization}/projects/{project}/limits |
Retrieves all usage limits for a project |
GET |
/usageLimits/organizations/{organization}/projects/{project}/limits/latest |
Retrieves the latest usage limit defined for a project |
GET |
/usageLimits/organizations/{organization}/projects/{project}/limits/active |
Retrieves the active usage limit for a project |
DELETE |
/usageLimits/organizations/{organization}/projects/{project}/limits/{id} |
Deletes an active usage limit for a project |
PUT |
/usageLimits/organizations/{organization}/projects/{project}/limits/{id}/hardLimit |
Modifies the hardLimit for an active usage limit for a project |
PUT |
/usageLimits/organizations/{organization}/projects/{project}/limits/{id}/softLimit |
Modifies the softLimit for an active usage limit for a project |
PUT |
/usageLimits/organizations/{organization}/projects/{project}/limits/{id}/renewalStatus |
Modifies the renewalStatus for an active usage limit for a project |
Defines a new usage limit for an organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
Name |
Type |
Description |
subscriptionType |
string |
Type of subscription. Options: Freemium, Daily, Weekly, Monthly |
usageUnit |
string |
Unit for the usage limit. Options: Cost |
softLimit |
number |
Soft usage limit. |
hardLimit |
number |
Hard usage limit. |
renewalStatus |
string |
Whether the limit is renewable. Options: Renewable, NonRenewable |
{
"subscriptionType": "string", // Options: Freemium, Daily, Weekly, Monthly
"usageUnit": "string", // Options: Cost (Only Cost is allowed for organization limits)
"softLimit": number, // Recommended usage limit
"hardLimit": number, // Maximum allowed usage
"renewalStatus": "string" // Options: Renewable, NonRenewable
}
If the endpoint is successful, it will return a 201 Created status with the usage limit data:
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (400 Bad Request, 401 Unauthorized, 403 Forbidden, 409 Conflict) with a JSON body containing an errors array:
{
"errors":
{
"id": integer,
"description": string
}
}
curl -X POST "$BASE_URL/v2/usageLimits/organizations/${organization}/limits" \
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
-H "Accept: application/json" \
-d '{
"subscriptionType": "Monthly",
"usageUnit": "Cost",
"softLimit": 10.00,
"hardLimit": 20.00,
"renewalStatus": "Renewable"
}'
Retrieves the latest usage limit defined for the organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
If the endpoint is successful, it will return a 200 OK status with the latest usage limit data:
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X GET "$BASE_URL/v2/usageLimits/organizations/${organization}/limits/latest" \
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
-H "Accept: application/json"
Retrieves all usage limits defined for a specified organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
Returns a JSON object containing an array of usageLimits for the specified organization. If no usage limits exist for the organization, an empty array will be returned.
{
"usageLimits":
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Organization"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
},
// ... more usageLimits (if any)
}
curl -X GET "$BASE_URL/v2/usageLimits/organizations/${organization}/limits"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
Deletes an active usage limit for the organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
If the endpoint is successful, it will return a 200 OK status with the limit status set to "Cancelled":
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer, // Will be 4 (Cancelled)
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X DELETE "$BASE_URL/v2/usageLimits/organizations/${organization}/limits/${id}" \
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
-H "Accept: application/json"
Modifies the hardLimit property of an active usage limit for a specified organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
{
"hardLimit": number
}
Returns the updated usage limit object. The hardLimit field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/limits/${id}/hardLimit" \
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
-H "Accept: application/json" \
-d '{
"hardLimit": 30.00
}'
Modifies the softLimit property of an active usage limit for a specified organization.
This endpoint requires a Globant Enterprise AI API token related to organization scope.
{
"softLimit": number
}
Returns the updated usage limit object. The softLimit field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/limits/${id}/softLimit"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
-d '{
"softLimit": 15.00
}'
Modifies the renewalStatus property of an active usage limit for a specified organization.
The following endpoints require a Globant Enterprise AI API token related to project scope.
{
"renewalStatus": string // Options: Renewable, NonRenewable
}
Returns the updated usage limit object. The renewalStatus field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string,
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/limits/${id}/renewalStatus"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
-d '{
"renewalStatus": "Renewable"
}'
Defines a new usage limit for a specified project within a given organization.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
Name |
Type |
Description |
subscriptionType |
string |
Type of subscription. Options: Freemium, Daily, Weekly, Monthly |
usageUnit |
string |
Unit for the usage limit. Options: Requests, Cost |
softLimit |
number |
Soft usage limit. Must be less than or equal to the hardLimit. |
hardLimit |
number |
Hard usage limit. Must be greater than or equal to the softLimit. |
renewalStatus |
string |
Whether the limit is renewable. Options: Renewable, NonRenewable |
{
"subscriptionType": "string", // Options: Freemium, Daily, Weekly, Monthly
"usageUnit": "string", // Options: Requests, Cost
"softLimit": number, // Recommended usage limit
"hardLimit": number, // Maximum allowed usage
"renewalStatus": "string" // Options: Renewable, NonRenewable
}
Returns the newly created usage limit object, including a generated id, remainingUsage, usedAmount, validFrom, and validUntil. The response structure is consistent with other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer, // Will be 1 (Active)
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict) with a JSON body containing an errors array (see example in previous responses).
curl -X POST "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits" \
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
-H "Accept: application/json" \
-d '{
"subscriptionType": "Daily",
"usageUnit": "Requests",
"softLimit": 1000,
"hardLimit": 2000,
"renewalStatus": "Renewable"
}'
Retrieves all usage limits defined for a specified project within a given organization.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
Returns a JSON object containing an array of usageLimits for the specified project. If no usage limits exist for the project, an empty array will be returned.
{
"usageLimits":
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
},
// ... more usageLimits (if any)
}
curl -X GET "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
Retrieves the latest usage limit defined for a specified project within a given organization.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
Returns a JSON object representing the latest usage limit for the project. If no usage limit exists, a 404 Not Found error is returned.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X GET "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/latest"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
Retrieves the currently active usage limit for a specified project within a given organization.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
Returns a JSON object representing the active usage limit for the project. If no active usage limit exists, a 404 Not Found error is returned. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer, // Will be 1 (Active)
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
curl -X GET "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/active"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
Deletes a specified usage limit for a project.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
Returns the deleted usage limit object. The status field will be updated to 4 (Cancelled). The response structure is consistent with other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer, // Will be 4 (Cancelled)
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (401 Unauthorized, 403 Forbidden, 404 Not Found) with a JSON body containing an errors array (see example in previous responses).
curl -X DELETE "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/${id}"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
Modifies the hardLimit property of an active usage limit for a specified project.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
{
"hardLimit": number
}
Returns the updated usage limit object. The hardLimit field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found) with a JSON body containing an errors array (see example in previous responses).
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/${id}/hardLimit"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
-d '{
"hardLimit": 3000
}'
Modifies the softLimit property of an active usage limit for a specified project.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
{
"softLimit": number
}
Returns the updated usage limit object. The softLimit field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found) with a JSON body containing an errors array (see example in previous responses).
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/${id}/softLimit"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
-d '{
"softLimit": 1500
}'
Modifies the renewalStatus property of an active usage limit for a specified project.
This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.
{
"renewalStatus": string // Options: Renewable, NonRenewable
}
Returns the updated usage limit object. The renewalStatus field will reflect the new value. The response structure is the same as for other successful limit retrieval endpoints.
{
"hardLimit": number,
"id": string,
"relatedEntityName": string, // Will be "Pia.Data.Project"
"remainingUsage": number,
"renewalStatus": string,
"softLimit": number,
"status": integer,
"subscriptionType": string,
"usageUnit": string,
"usedAmount": number,
"validFrom": string, // Datetime
"validUntil": string // Datetime
}
Error responses will return appropriate HTTP status codes (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found) with a JSON body containing an errors array (see example in previous responses).
curl -X PUT "$BASE_URL/v2/usageLimits/organizations/${organization}/projects/${project}/limits/${id}/renewalStatus"
-H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN"
-H "Accept: application/json"
-d '{
"renewalStatus": "NonRenewable"
}'