Skip to main content
PUT
/
segments
/
{segment_token}
Update segment
curl --request PUT \
  --url https://api.vantage.sh/v2/segments/{segment_token} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "priority": 123,
  "track_unallocated": false,
  "report_settings": {
    "include_credits": true,
    "include_refunds": true,
    "include_discounts": true,
    "include_tax": true,
    "amortize": true
  },
  "filter": "<string>",
  "parent_segment_token": "<string>"
}
'
{
  "token": "fltr_sgmt_1550eb291314035c",
  "title": "Updated Segment",
  "parent_segment_token": "fltr_sgmt_a39cf865967ed4d8",
  "description": "This segment is updated.",
  "track_unallocated": false,
  "priority": 42,
  "filter": "costs.provider = 'azure'",
  "created_at": "2024-05-14T14:34:23Z",
  "workspace_token": "wrkspc_1be9d0445f94db0b",
  "report_token": "rprt_3e460438ae115013"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

segment_token
string
required

Body

application/json

Update a Segment.

title
string

The title of the Segment.

description
string

The description of the Segment.

priority
integer<int32>

The priority of the Segment.

track_unallocated
boolean
default:false

Track Unallocated Costs which are not assigned to any of the created Segments.

report_settings
object

Report settings configurable on top-level Segments.

filter
string

The filter query language to apply to the Segment. Additional documentation available at https://docs.vantage.sh/vql.

parent_segment_token
string

The token of the parent Segment this new Segment belongs to. Determines the Workspace the segment is assigned to.

Response

Segment model

token
string
title
string

The title of the Segment.

Example:

"OPEX"

parent_segment_token
string

The token of the parent Segment of this Segment.

description
string

The description of the Segment.

Example:

"Operating expenses"

track_unallocated
boolean

Track Unallocated Costs which are not assigned to any of the created Segments.

Example:

false

report_settings
object

Report settings configurable on top-level Segments.

priority
integer<int32>

Costs are assigned in priority order across all Segments with assigned filters.

Example:

100

filter
string

The filter applied to the Segment. Additional documentation available at https://docs.vantage.sh/vql.

created_at
string

The date and time, in UTC, the Segment was created. ISO 8601 Formatted.

Example:

"2021-07-09T00:00:00Z"

workspace_token
string

The token for the Workspace the Segment is a part of.

report_token
string

The token for the Report the Segment has generated.