Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

File Store

This contains APIs related to File Store in Harness

List Files and Folders metadata

get
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

identifiersstring[]Optional

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

searchTermstringOptional

This will be used to filter files or folders. Any file or folder having the specified search term in its Name or Identifier will be filtered

pageIndexinteger · int32Optional

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

Default: 0
pageSizeinteger · int32 · max: 100Optional

Results per page(max 100)Default Value: 50

Default: 50
pageTokenstringOptional

Page Token of the next results to fetch.Default Value: ''

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store
GET /gateway/ng/api/file-store?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create Folder or File including content

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body
tagsstringOptional

The File or Folder tags. (See example for expected format)

contentobjectOptional

The content of the File as InputStream

identifierstringOptional

Identifier of the File or Folder

namestringRequired

Name of the File or Folder

fileUsagestringOptional

This specifies the file usage

typestring · enumRequired

This specifies the type of the File

Possible values:
parentIdentifierstringRequired

This specifies parent directory identifier. The value of Root directory identifier is Root.

descriptionstringOptional

Description of the File or Folder

mimeTypestringOptional

Mime type of the File

pathstringOptional

The path of the File or Folder

lastModifiedAtinteger · int64Optional

Last modified time for the File or Folder

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/file-store
POST /gateway/ng/api/file-store?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: multipart/form-data
Accept: */*
Content-Length: 284

{
  "tags": "text",
  "content": {},
  "identifier": "text",
  "name": "text",
  "fileUsage": "text",
  "type": "FILE",
  "parentIdentifier": "text",
  "description": "text",
  "mimeType": "text",
  "path": "text",
  "createdBy": {
    "name": "text",
    "email": "text"
  },
  "lastModifiedBy": {
    "name": "text",
    "email": "text"
  },
  "lastModifiedAt": 1
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Creates File or Folder metadata via YAML

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body

Wrapper object for File Store YAML operations containing a file field with File or Folder metadata.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/file-store/yaml
POST /gateway/ng/api/file-store/yaml?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/yaml
Accept: */*
Content-Length: 349

"file:
  accountIdentifier: text
  orgIdentifier: text
  projectIdentifier: text
  identifier: text
  name: text
  fileUsage: text
  type: FILE
  parentIdentifier: text
  description: text
  tags:
    - key: text
      value: text
  mimeType: text
  createdBy:
    name: text
    email: text
  lastModifiedBy:
    name: text
    email: text
"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get the Folder or File metadata

get
Path parameters
identifierstringRequired

The file identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/{identifier}
GET /gateway/ng/api/file-store/{identifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update Folder or File including content

put
Path parameters
identifierstringRequired

The file identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body
tagsstringOptional

The File or Folder tags. (See example for expected format)

identifierstringOptional

Identifier of the File or Folder

namestringRequired

Name of the File or Folder

fileUsagestringOptional

This specifies the file usage

typestring · enumRequired

This specifies the type of the File

Possible values:
parentIdentifierstringRequired

This specifies parent directory identifier. The value of Root directory identifier is Root.

descriptionstringOptional

Description of the File or Folder

mimeTypestringOptional

Mime type of the File

pathstringOptional

The path of the File or Folder

lastModifiedAtinteger · int64Optional

Last modified time for the File or Folder

contentobjectOptional

The content of the File as InputStream

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/file-store/{identifier}
PUT /gateway/ng/api/file-store/{identifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: multipart/form-data
Accept: */*
Content-Length: 284

{
  "tags": "text",
  "identifier": "text",
  "name": "text",
  "fileUsage": "text",
  "type": "FILE",
  "parentIdentifier": "text",
  "description": "text",
  "mimeType": "text",
  "path": "text",
  "createdBy": {
    "name": "text",
    "email": "text"
  },
  "lastModifiedBy": {
    "name": "text",
    "email": "text"
  },
  "lastModifiedAt": 1,
  "content": {}
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete File or Folder by identifier

delete
Path parameters
identifierstringRequired

The file identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

forceDeletebooleanOptional

If true, the Entity will be forced delete, without checking any references/usages

Default: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/file-store/{identifier}
DELETE /gateway/ng/api/file-store/{identifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Download File

get
Path parameters
identifierstringRequired

The file identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/files/{identifier}/download
GET /gateway/ng/api/file-store/files/{identifier}/download?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get list of created by user details

get
Query parameters
accountIdentifierstringOptional

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/files/createdBy
GET /gateway/ng/api/file-store/files/createdBy HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}
Deprecated

Get file content of scopedFilePath

get
Path parameters
scopedFilePathstringRequired

The scoped file path reference. The path must start with '/' and can be prefixed with a scope: 'account:/my-file' for account scope, 'org:/my-file' for org scope, or 'project:/my-file' (or just '/my-file') for project scope. The request body must be a plain string (not JSON-encoded). Do not wrap the path in quotes.

Query parameters
accountIdentifierstringOptional

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/files/{scopedFilePath}/content
GET /gateway/ng/api/file-store/files/{scopedFilePath}/content HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get file content by file path

post

Returns the content of a file in the Harness file store as a string. The request body must be a plain-text string containing the scoped file path (not JSON-encoded, do not wrap in quotes). For account scope, prefix with 'account:' (e.g., 'account:/my-file'). For org scope, prefix with 'org:' (e.g., 'org:/my-file'). For project scope, optionally prefix with 'project:' or just provide the path (e.g., '/my-file'). The path must start with '/'. Scope query parameters must also match: project scope requires accountIdentifier, orgIdentifier, and projectIdentifier; org scope requires accountIdentifier and orgIdentifier; account scope requires only accountIdentifier.

Query parameters
accountIdentifierstringOptional

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body
stringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/file-store/files/content
POST /gateway/ng/api/file-store/files/content HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 6

"text"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get list of entities where file is referenced by queried entity type

get
Path parameters
identifierstringRequired

The file identifier

Query parameters
pageIndexinteger · int32Optional

Page number of navigation. The default value is 0

Default: 0
pageSizeinteger · int32 · max: 1000Optional

Number of entries per page. The default value is 100

Default: 100
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

entityTypestring · enumOptional

Entity type

Possible values:
searchTermstringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/{identifier}/referenced-by
GET /gateway/ng/api/file-store/{identifier}/referenced-by?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get the list of supported entity types for files

get
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/file-store/supported-entity-types
GET /gateway/ng/api/file-store/supported-entity-types?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get filtered list of Files or Folders

post
Query parameters
pageIndexinteger · int32Optional

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

Default: 0
pageSizeinteger · int32 · max: 100Optional

Results per page(max 100)Default Value: 50

Default: 50
pageTokenstringOptional

Page Token of the next results to fetch.Default Value: ''

accountIdentifierstringOptional

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

filterIdentifierstringOptional

Filter identifier

searchTermstringOptional

This will be used to filter files or folders. Any file or folder having the specified search term in its Name or Identifier will be filtered

Body

Properties of the Files Filter defined in Harness

fileUsagestring · enumOptional

This specifies the file usage

Possible values:
filterTypestring · enumRequired

This specifies the corresponding Entity of the filter.

Possible values:
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/file-store/files/filter
POST /gateway/ng/api/file-store/files/filter HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 188

{
  "fileUsage": "MANIFEST_FILE",
  "createdBy": {
    "name": "text",
    "email": "text"
  },
  "referencedBy": {
    "type": "CreatePR",
    "name": "text"
  },
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "filterType": "Connector"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get folder nodes at first level, not including sub-nodes

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

fileUsagestring · enumOptional

The file usage

Possible values:
Body

This contains folder details

identifierstring · min: 1 · max: 2147483647Required

Identifier of the File Store Node

parentIdentifierstringOptional

Parent identifier of the File Store Node

namestring · min: 1 · max: 2147483647Required

Name of the File Store Node

typestring · enumRequired

Type of the File Store Node

Possible values:
pathstringRead-onlyOptional

Path of the file or folder

lastModifiedAtinteger · int64Read-onlyOptional

Last modified time for the File Store Node

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/file-store/folder
POST /gateway/ng/api/file-store/folder?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 260

{
  "identifier": "text",
  "parentIdentifier": "text",
  "name": "text",
  "type": "FILE",
  "lastModifiedBy": {
    "name": "text",
    "email": "text"
  },
  "children": [
    {
      "identifier": "text",
      "parentIdentifier": "text",
      "name": "text",
      "type": "FILE",
      "lastModifiedBy": {
        "name": "text",
        "email": "text"
      }
    }
  ]
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update File or Folder metadata via YAML

put

Updates the metadata of an existing file or folder using a YAML payload. This endpoint updates metadata (name, description, tags, etc.) only.

Path parameters
identifierstringRequired

The file identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body

Wrapper object for File Store YAML operations containing a file field with File or Folder metadata.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/file-store/yaml/{identifier}
PUT /gateway/ng/api/file-store/yaml/{identifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/yaml
Accept: */*
Content-Length: 240

"|
  file:
    identifier: my_config_file
    name: My Config File
    type: FILE
    fileUsage: CONFIG
    parentIdentifier: Root
    description: Sample configuration file
    mimeType: text/plain
    tags:
      - key: env
        value: production
"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?