Create relationship
PUT {{baseUrl}}/api/relation/:relationName/from/:sourceType/:sourceKey/to/:targetType/:targetKey?sourceStatus=<string>&targetStatus=<string>&sourceVersion=<integer>&targetVersion=<integer>
Creates a relationship between two entities (user, space, content). The 'favourite' relationship is supported by default, but you can use this method to create any type of relationship between two entities.
For example, the following method creates a 'sibling' relationship between
two pieces of content:
GET https://your-domain.atlassian.net/wiki/rest/api/relation/sibling/from/content/123/to/content/456
Permissions required: Permission to access the Confluence site ('Can use' global permission).
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
sourceStatus | string | The status of the source. This parameter is only used when the | |
sourceType is 'content'. | |||
targetStatus | string | The status of the target. This parameter is only used when the | |
targetType is 'content'. | |||
sourceVersion | string | The version of the source. This parameter is only used when the | |
sourceType is 'content' and the sourceStatus is 'historical'. | |||
targetVersion | string | The version of the target. This parameter is only used when the | |
targetType is 'content' and the targetStatus is 'historical'. |
RESPONSES
status: OK
{"name":"laborum amet","_expandable":{"relationData":"minim do quis","source":"quis velit dolore ut","target":"sint fugiat id repreh"},"_links":{},"relationData":{"createdBy":{"type":"known","accountId":"est veniam nisi","accountType":"atlassian","email":"fugiat tempor est","publicName":"proident cillum adipisicing","profilePicture":{"path":"incididunt dolore sit in eu","width":66665902,"height":7198703,"isDefault":false},"displayName":"mollit ex pariatur dolor","_expandable":{"operations":"adipisicing in","details":"id minim sed","personalSpace":"Ut"},"_links":{},"username":"proident ut incididunt consequat","userKey":"ipsum consequat sed ullamco aliquip","operations":[{"operation":"copy","targetType":"space"},{"operation":"purge_version","targetType":"space"}],"details":{"business":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"personal":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"personalSpace":{"id":32251017,"key":"Excepteur do","name":"est velit non","type":"deserunt occaecat","status":"in commodo incididunt non","_expandable":{"settings":"ut cillum quis in","metadata":"dolore minim","operations":"anim commodo amet","lookAndFeel":"dolore Lorem","permissions":"dolore anim","icon":"deserunt ex occaecat amet","description":"cillum nostrud sint","theme":"dolor id","history":"in fugiat eu esse","homepage":"et"},"_links":{},"icon":{"path":"laboris eiusmod Excepteur eu","width":-89581460,"height":-66835718,"isDefault":true},"description":{"plain":{"value":"ut eu reprehenderit","representation":"view","embeddedContent":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]},"view":{"value":"reprehenderit","representation":"view","embeddedContent":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}]}},"homepage":{"value":"\u003cCircular reference to #/components/schemas/Content detected\u003e"},"metadata":{"labels":{"results":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}],"start":83305188,"limit":81363289,"size":-91970205,"_links":{}}},"operations":[{"operation":"purge","targetType":"comment"},{"operation":"use","targetType":"blogpost"}],"permissions":[{"subjects":{"_expandable":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"user":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"group":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"operation":{"operation":"purge_version","targetType":"page"},"anonymousAccess":false,"unlicensedAccess":false},{"subjects":{"_expandable":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"user":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"group":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"operation":{"operation":"administer","targetType":"blogpost"},"anonymousAccess":false,"unlicensedAccess":false}],"settings":{"routeOverrideEnabled":true,"_links":{}},"theme":{},"lookAndFeel":{"headings":{"color":"fugiat irure nostrud"},"links":{"color":"ad velit"},"menus":{"hoverOrFocus":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"color":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"header":{"backgroundColor":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"button":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"primaryNavigation":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"secondaryNavigation":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"search":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"content":{"screen":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"container":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"header":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"body":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"bordersAndDividers":{"color":"do in laborum"}},"history":{"createdDate":"1968-05-01T03:07:38.118Z"}}},"createdDate":"1955-09-27T16:15:59.770Z","friendlyCreatedDate":"reprehenderit quis"},"source":{},"target":{}}