Skip to content
English
  • There are no suggestions because the search field is empty.

Create project-scoped indicator

POST /api/v2/projects/{projectId}/indicators Select code sample Fetch cURL
const url = 'https://localhost:10001/api/v2/projects/1/indicators';const options = {  method: 'POST',  headers: {Authorization: '
  
   ', 'Content-Type': 'application/json'}, body: '{"criteria":[{}],"declarationProfile":{"emitOn":"pass","statementTemplate":"example","titleTemplate":"example"},"description":"example","extractionRules":{},"name":"example","parameters":{},"provider":"example","slug":"example","tags":["example"],"triggerType":"event","type":"custom"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}
  
curl --request POST \  --url https://localhost:10001/api/v2/projects/1/indicators \  --header 'Authorization: 
  
   ' \ --header 'Content-Type: application/json' \ --data '{ "criteria": [ {} ], "declarationProfile": { "emitOn": "pass", "statementTemplate": "example", "titleTemplate": "example" }, "description": "example", "extractionRules": {}, "name": "example", "parameters": {}, "provider": "example", "slug": "example", "tags": [ "example" ], "triggerType": "event", "type": "custom" }'
  

Creates an immutable indicator template owned by a project and returns the created template

Authorizations

Section titled “Authorizations ”

Parameters

Section titled “ Parameters ”

Path Parameters

Section titled “Path Parameters ” projectId required integer

Project ID

Request Body

Section titled “Request Body ”

Project indicator creation request

Media type application/json object criteria Array object declarationProfile required object emitOn

“pass” | “fail” | “both” | “none”

stringAllowed values: pass fail both none statementTemplate string titleTemplate string description string extractionRules object name required string parameters object provider string slug string tags Array triggerType required stringAllowed values: event type required stringAllowed values: custom

Responses

Section titled “ Responses ”

201

Section titled “201 ”

Created project indicator template

Media type application/json object createdAt string criteria Array object declarationProfile object emitOn

“pass” | “fail” | “both” | “none”

stringAllowed values: pass fail both none statementTemplate string titleTemplate string description string extractionRules object id string name string parameters object projectId integer provider string slug string tags Array triggerType stringAllowed values: event type stringAllowed values: custom updatedAt string usageCount integer
Example
{  "declarationProfile": {    "emitOn": "pass"  },  "triggerType": "event",  "type": "custom"}

400

Section titled “400 ”

Bad request - Invalid request body or indicator fields

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}

401

Section titled “401 ”

Unauthorized - Authentication required

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}

403

Section titled “403 ”

Forbidden - No project access or insufficient permissions

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}

404

Section titled “404 ”

Project not found

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}

409

Section titled “409 ”

Indicator with the same slug already exists

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}

500

Section titled “500 ”

Internal server error

Media type application/json object key additional properties string
Example generated
{  "additionalProperty": "example"}
Previous
List project-scoped indicators
Next
Get project-scoped indicator