Method: assetRelationships.insert
Stay organized with collections
Save and categorize content based on your preferences.
Creates a relationship that links two assets.
HTTP request
POST https://youtubepartner.googleapis.com/youtube/partner/v1/assetRelationships
The URL uses gRPC Transcoding
syntax.
Query parameters
Parameters |
onBehalfOfContentOwner
|
string
The onBehalfOfContentOwner
parameter identifies the content owner that the user is acting on behalf of. This parameter supports users whose accounts are associated with multiple content owners.
|
Request body
The request body contains an instance of AssetRelationship
.
Response body
If successful, the response body contains a newly created instance of AssetRelationship
.
Authorization scopes
Requires the following OAuth scope:
-
https://www.googleapis.com/auth/youtubepartner
For more information, see the OAuth 2.0 Overview
.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eCreates a relationship that links two assets using an HTTP POST request.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/youtubepartner\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eRequest body should contain an \u003ccode\u003eAssetRelationship\u003c/code\u003e object defining the relationship.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses return the newly created \u003ccode\u003eAssetRelationship\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, specify \u003ccode\u003eonBehalfOfContentOwner\u003c/code\u003e for users associated with multiple content owners.\u003c/p\u003e\n"]]],["This document details the process for creating a relationship between two assets using the YouTube Partner API. A `POST` request is sent to `https://youtubepartner.googleapis.com/youtube/partner/v1/assetRelationships`. The `onBehalfOfContentOwner` query parameter specifies the content owner. The request body must contain `AssetRelationship` data, and a successful response returns a newly created `AssetRelationship`. This process requires the `https://www.googleapis.com/auth/youtubepartner` OAuth scope.\n"],null,["# Method: assetRelationships.insert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a relationship that links two assets.\n\n### HTTP request\n\n`POST https://youtubepartner.googleapis.com/youtube/partner/v1/assetRelationships`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `onBehalfOfContentOwner` | `string` The `onBehalfOfContentOwner` parameter identifies the content owner that the user is acting on behalf of. This parameter supports users whose accounts are associated with multiple content owners. |\n\n### Request body\n\nThe request body contains an instance of [AssetRelationship](/youtube/partner/reference/rest/v1/assetRelationships#AssetRelationship).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [AssetRelationship](/youtube/partner/reference/rest/v1/assetRelationships#AssetRelationship).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/youtubepartner`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]