Service Account

This has all the APIs specific to the Service Accounts in Harness.

Create a Service Account

Creates a new Service Account.

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema:

Details required to create Service Account

identifier
required
string

Identifier of the Service Account.

name
required
string

Name of the Service Account.

email
required
string

Email of the Service Account.

description
string [ 0 .. 1024 ] characters

Description of the Service Account.

object

Tags of the Service Account.

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns details of the created Service Account

post/ng/api/serviceaccount
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "email": "string",
  • "description": "string",
  • "tags": {
    },
  • "accountIdentifier": "string",
  • "orgIdentifier": "string",
  • "projectIdentifier": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete a Service Account

Deletes a Service Account corresponding to the given Service Account ID.

SecurityApiKey
Request
path Parameters
identifier
required
string

Service Account ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

It returns true if the Service Account is deleted successfully and false if the Service Account is not deleted.

delete/ng/api/serviceaccount/{identifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get Service Account In Scope

Gets the list of Service Accounts in the given scope.

SecurityApiKey
Request
path Parameters
identifier
required
string

Service Account IDr

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the Service Account details corresponding to the specified Account Identifier and Service Account Identifier

get/ng/api/serviceaccount/aggregate/{identifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get Service Accounts

Fetches list of Service Accounts for the given filter criteria.

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

identifiers
Array of strings

This is the list of Service Account IDs. Details specific to these IDs would be fetched.

Responses
400

Bad Request

500

Internal server error

default

Returns the list of Service Accounts.

get/ng/api/serviceaccount
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

List aggregated Service Accounts

Fetches the list of Aggregated Service Accounts corresponding to the request's filter criteria.

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

identifiers
Array of strings

This is the list of Service Account IDs. Details specific to these IDs would be fetched.

pageIndex
integer <int32>
Default: 0

Page Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

searchTerm
string

This would be used to filter Service Accounts. Any Service Account having the specified string in its Name, ID and Tag would be filtered.

Responses
400

Bad Request

500

Internal server error

default

Returns the paginated list of Aggregated Service Accounts.

get/ng/api/serviceaccount/aggregate
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update a Service Account

Updates details of the Service Account for the given Service Account ID.

SecurityApiKey
Request
path Parameters
identifier
required
string

Service Account ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema:

Details of the updated Service Account

identifier
required
string

Identifier of the Service Account.

name
required
string

Name of the Service Account.

email
required
string

Email of the Service Account.

description
string [ 0 .. 1024 ] characters

Description of the Service Account.

object

Tags of the Service Account.

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the updated Service Account details.

put/ng/api/serviceaccount/{identifier}
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "email": "string",
  • "description": "string",
  • "tags": {
    },
  • "accountIdentifier": "string",
  • "orgIdentifier": "string",
  • "projectIdentifier": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}