create or update account filter.md

Create or Update Account Filter

Media API · Asset Filters

PUT https://app.mk.io/api/v1/projects/{project_name}/media/accountFilters/{filter_name}

Create or Update Account Filter.

RBAC Capability Required: ams.accountfilter.create or ams.accountfilter.update

Authentication

Path parameters

Name Type Required Description
project_name string Yes
filter_name string Yes

Request body

Content type: application/json

        - Array items (object):
          - `operation` · enum · **Required** — Set to either 'Equal' or 'NotEqual'. Tracks matching this predicate will be included. Examples: To include all audio tracks, set operation to 'Equal', property to 'Type', and value to 'Audio'.
            - Allowed values: `Equal`, `NotEqual`
          - `property` · enum · **Required** — The property to match against. Supported properties include: Bitrate, FourCC, Language, Name, Type, and Unknown. - Bitrate may be provided as a single numeric value '100000' or as a range '500000-1000000'. - FourCC is the codec, and may be one of 'avc1', 'hev1', and 'hvc1' for video, or one of 'mp4a' and 'ec-3' for audio. - Language is the value of a language tag to include, as specified in RFC 5646. - Name is the name of the track as specified in the manifest. - Type is one of either 'video', 'audio', or 'text'.
            - Allowed values: `Unknown`, `Type`, `Name`, `Language`, `FourCC`, `Bitrate`
          - `value` · string · **Required** — The value to match against. Values are not case-sensitive.

## Example request

```bash
curl -X PUT "https://app.mk.io/api/v1/projects/{project_name}/media/accountFilters/{filter_name}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "properties": {
    "firstQuality": {
      "bitrate": 0
    },
    "presentationTimeRange": {
      "endTime": "2024-01-01T00:00:00Z",
      "endTimestamp": 0,
      "forceEndTimestamp": true,
      "liveBackoffDuration": 0,
      "presentationWindowDuration": 0,
      "startTime": "2024-01-01T00:00:00Z",
      "startTimestamp": 0,
      "timescale": 10000000
    },
    "tracks": [
      {
        "trackSelections": [
          {
            "operation": "Equal",
            "property": "Unknown",
            "value": "string"
          }
        ]
      }
    ]
  }
}'

Responses

200 — Account Filter was updated

        - Array items (object):
          - `operation` · enum · **Required** — Set to either 'Equal' or 'NotEqual'. Tracks matching this predicate will be included. Examples: To include all audio tracks, set operation to 'Equal', property to 'Type', and value to 'Audio'.
            - Allowed values: `Equal`, `NotEqual`
          - `property` · enum · **Required** — The property to match against. Supported properties include: Bitrate, FourCC, Language, Name, Type, and Unknown. - Bitrate may be provided as a single numeric value '100000' or as a range '500000-1000000'. - FourCC is the codec, and may be one of 'avc1', 'hev1', and 'hvc1' for video, or one of 'mp4a' and 'ec-3' for audio. - Language is the value of a language tag to include, as specified in RFC 5646. - Name is the name of the track as specified in the manifest. - Type is one of either 'video', 'audio', or 'text'.
            - Allowed values: `Unknown`, `Type`, `Name`, `Language`, `FourCC`, `Bitrate`
          - `value` · string · **Required** — The value to match against. Values are not case-sensitive.
- `systemData` · object · Optional — Metadata pertaining to creation and last modification of the resource.
  - `createdAt` · string · **Required** · _format: date-time_ — The timestamp of resource creation (UTC).
  - `createdBy` · string · **Required** — The identity that created the resource.
  - `createdByType` · enum · **Required** — The type of identity that created the resource.
    - Allowed values: `User`, `Application`, `ManagedIdentity`, `Key`
  - `internalId` · string · **Required** · _format: uuid_ — The internal ID of the resource.
  - `lastModifiedAt` · string · **Required** · _format: date-time_ — The timestamp of resource last modification (UTC).
  - `lastModifiedBy` · string · **Required** — The identity that last modified the resource.
  - `lastModifiedByType` · enum · **Required** — The type of identity that last modified the resource.
    - Allowed values: `User`, `Application`, `ManagedIdentity`, `Key`
- `type` · string · Optional — The type of the resource. E.g. "Microsoft.Media/mediaservices/assets"

Example:

```json
{
  "id": "string",
  "name": "name",
  "properties": {
    "firstQuality": {
      "bitrate": 0
    },
    "presentationTimeRange": {
      "endTime": "2024-01-01T00:00:00Z",
      "endTimestamp": 0,
      "forceEndTimestamp": true,
      "liveBackoffDuration": 0,
      "presentationWindowDuration": 0,
      "startTime": "2024-01-01T00:00:00Z",
      "startTimestamp": 0,
      "timescale": 10000000
    },
    "tracks": [
      {
        "trackSelections": [
          {
            "operation": "Equal",
            "property": "Unknown",
            "value": "string"
          }
        ]
      }
    ]
  },
  "systemData": {
    "createdAt": "2024-01-01T00:00:00Z",
    "createdBy": "string",
    "createdByType": "User",
    "internalId": "00000000-0000-0000-0000-000000000000",
    "lastModifiedAt": "2024-01-01T00:00:00Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User"
  },
  "type": "string"
}

201 — Account Filter was created

Example:

400 — Bad Request

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

401 — Unauthorized

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

403 — Forbidden

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

404 — Not Found

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

429 — Too Many Requests

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

500 — Internal Server Error

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

Source spec: media-api · operationId: [put]_/api/v1/projects/{project_name}/media/accountFilters/{filter_name}