Service Account

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

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

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/serviceaccount?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&identifiers=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a Service Account

Request
Security:
ApiKey (readwrite)
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
string
name
string
email
string
description
string [ 0 .. 1024 ] characters
object
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
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": [
    ]
}

Updates the Service Account.

Request
Security:
ApiKey (readwrite)
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
string
name
string
email
string
description
string [ 0 .. 1024 ] characters
object
accountIdentifier
string
orgIdentifier
string
projectIdentifier
string
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": [
    ]
}

Deletes Service Account by ID

Request
Security:
ApiKey (readwrite)
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
curl -i -X DELETE \
  'https://app.harness.io/gateway/ng/api/serviceaccount/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
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

Indicates the number of pages. Results for these pages will be retrieved.

pageSize
integer <int32>
Default: 50

The number of the elements to fetch

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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/serviceaccount/aggregate?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&identifiers=string&pageIndex=0&pageSize=50&sortOrders=%5Bobject%20Object%5D&searchTerm=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get the Service Account by accountIdentifier and Service Account ID and Scope.

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/serviceaccount/aggregate/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}