Projects

API Reference - Projects resource

This namespace allows you to retrieve information about Currents Projects:

  • Get the list of projects for your organization

  • Get specific project details

  • Get the list of runs for a project

List Projects

GET v1/projects

Query Parameters

Name
Type
Description

limit

number

Maximum number of results to return (1-100). Default: 10

starting_before

string

Pagination cursor for fetching results before this cursor. See Pagination

ending_after

string

Pagination cursor for fetching results after this cursor. See Pagination

{
    "status": "OK",
    "has_more": false,
    "data": [{
        "projectId": "emdaGd", // project id
        "name": "Hello Currents", // project name
        "createdAt": "2022-01-14T16:15:18.852Z", // creation date
        "inactivityTimeoutSeconds": 7200, // timeout value
        "cursor": "61e1a196954ca800138aae97", // pagination cursor
        "failFast": true // enable fail-fast strategy
    }]
}

Get Project

GET v1/projects/:projectId

Path Parameters

Name
Type
Description

projectId*

string

Project ID

{
    "status": "OK",
    "data": {
        "projectId": "emdaGd", // project id
        "name": "Hello Currents", // project name
        "createdAt": "2022-01-14T16:15:18.852Z", // creation date
        "inactivityTimeoutSeconds": 7200, // timeout value
        "failFast": true // enable fail-fast strategy
    }
}

Get Project Insights

GET v1/projects/:projectId/insights

Returns aggregated metrics for the project. See Insights and Analytics.

Path Parameters

Name
Type
Description

projectId*

string

Project ID

Query Parameters

Name
Type
Description

date_start*

string (ISO 8601)

Start date for filtering the query results

date_end*

string (ISO 8601)

End date for filtering the query results

resolution

enum

Aggregation resolution. Values: "1w", "1d"

tags[]

string

Filter by tag names. Multiple values: tags[]=valueA&tags[]=valueB

branches[]

string

Filter by branch names. Multiple values: branches[]=valueA&branches[]=valueB

authors[]

string

Filter by author names. Multiple values: authors[]=authorA&authors[]=authorB

groups[]

string

Filter by group names. Multiple values: groups[]=groupA&groups[]=groupB

type ResponsePayload = {
  status: "OK";
  data: ProjectInsights;
};

type ProjectInsights = {
  projectId: string;
  orgId: string;
  dateStart: string; // ISO date string
  dateEnd: string; // ISO date string
  resolution: "1w" | "1d"; 
  tags: string[];
  authors: string[];
  branches: string[];
  groups: string[];
  results: {
    overall: {
      runs: RunMetric;
      tests: TestMetric;
    };
    timeline: {
      [timestamp: number]: {
        runs: RunMetric;
        tests: TestMetric;
      };
    };
  };
};

type RunMetric = {
  total: number; // total number of runs for the period
  cancelled: number; // number of cancelled runs for the period
  timeouts: number; // number of timed-out runs for the period
  completed: number; // number of completed runs for the period
  failed: number; // number of failed runs for the period
  passed: number; // number of passed runs for the period
  avgDurationSeconds: number; // average duration of completed runs for the period
};

type TestMetric = {
  total: number; // total number of tests for the period
  failed: number; // number of failed tests for the period
  passed: number; // number of passed tests for the period
  pending: number; // number of pending tests for the period
  skipped: number; // number of skipped tests for the period
  flaky: number; // number of flaky tests for the period
};

Last updated

Was this helpful?