Rate this page:
GET /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}
Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
For example, the following method finds all content that the current user
has an 'ignore' relationship with:
GET https://your-domain.atlassian.net/wiki/rest/api/relation/ignore/from/user/current/to/content
Note, 'ignore' is an example custom relationship type.
Permissions required: Permission to view both the target entity and source entity.
App scope required: READ
read:confluence-content.summary
string
The name of the relationship. This method supports relationships created via Create relationship. Note, this method does not support 'favourite' relationships.
string
The source entity type of the relationship.
Valid values: user
, content
, space
string
The identifier for the source entity:
sourceType
is user
, then specify either current
(logged-in user), the user key of the user, or
the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the
migration guide
for details.sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The target entity type of the relationship.
Valid values: user
, content
, space
string
The status of the source. This parameter is only used when the
sourceType
is 'content'.
string
The status of the target. This parameter is only used when the
targetType
is 'content'.
integer
The version of the source. This parameter is only used when the
sourceType
is 'content' and the sourceStatus
is 'historical'.
int32
integer
The version of the target. This parameter is only used when the
targetType
is 'content' and the targetStatus
is 'historical'.
int32
Array<string>
A multi-value parameter indicating which properties of the response object to expand.
relationData
returns information about the relationship, such as
who created it and when it was created.source
returns the source entity.target
returns the target entity.form
Valid values: relationData
, source
, target
integer
The starting index of the returned relationships.
0
, Minimum: 0
, Format: int32
integer
The maximum number of relationships to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}' \
--header 'Accept: application/json'
Returned if the requested relationships are returned.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}
Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships are one way.
For example, you can use this method to find whether the current user has
selected a particular page as a favorite (i.e. 'save for later'):
GET https://your-domain.atlassian.net/wiki/rest/api/relation/favourite/from/user/current/to/content/123
Permissions required: Permission to view both the target entity and source entity.
App scope required: READ
read:confluence-content.summary
string
The name of the relationship. This method supports the 'favourite' (i.e. 'save for later') relationship as well as any other relationship types created via Create relationship.
string
The source entity type of the relationship. This must be 'user', if
the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the source entity:
If sourceType
is user
, then specify either current
(logged-in user), the user key of the user, or
the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the
migration guide
for details.
sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The target entity type of the relationship. This must be 'space' or
'content', if the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the target entity:
targetType
is user
, then specify either current
(logged-in user), the user key of the user, or
the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the
migration guide
for details.targetType
is 'content', then specify the content ID.targetType
is 'space', then specify the space key.string
The status of the source. This parameter is only used when the
sourceType
is 'content'.
string
The status of the target. This parameter is only used when the
targetType
is 'content'.
integer
The version of the source. This parameter is only used when the
sourceType
is 'content' and the sourceStatus
is 'historical'.
int32
integer
The version of the target. This parameter is only used when the
targetType
is 'content' and the targetStatus
is 'historical'.
int32
Array<string>
A multi-value parameter indicating which properties of the response object to expand.
relationData
returns information about the relationship, such as
who created it and when it was created.source
returns the source entity.target
returns the target entity.form
Valid values: relationData
, source
, target
1 2 3
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}' \
--header 'Accept: application/json'
Returned if the relationship exists.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}
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).
App scope required: WRITE
write:confluence-content
string
The name of the relationship. This method supports the 'favourite' (i.e. 'save for later') relationship. You can also specify any other value for this parameter to create a custom relationship type.
string
The source entity type of the relationship. This must be 'user', if
the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the source entity:
If sourceType
is 'user', then specify either 'current' (logged-in
user) or the user key.
sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The target entity type of the relationship. This must be 'space' or
'content', if the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the target entity:
If sourceType
is 'user', then specify either 'current' (logged-in
user) or the user key.
sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The status of the source. This parameter is only used when the
sourceType
is 'content'.
string
The status of the target. This parameter is only used when the
targetType
is 'content'.
integer
The version of the source. This parameter is only used when the
sourceType
is 'content' and the sourceStatus
is 'historical'.
int32
integer
The version of the target. This parameter is only used when the
targetType
is 'content' and the targetStatus
is 'historical'.
int32
1 2 3
curl --request PUT \
--url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}' \
--header 'Accept: application/json'
Returned if the relationship is created.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}
Deletes a relationship between two entities (user, space, content).
Permissions required: Permission to access the Confluence site ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite relationships. A space administrator can delete favourite relationships for any user.
App scope required: DELETE
write:confluence-content
string
The name of the relationship.
string
The source entity type of the relationship. This must be 'user', if
the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the source entity:
If sourceType
is 'user', then specify either 'current' (logged-in
user) or the user key.
sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The target entity type of the relationship. This must be 'space' or
'content', if the relationName
is 'favourite'.
Valid values: user
, content
, space
string
The identifier for the target entity:
If sourceType
is 'user', then specify either 'current' (logged-in
user) or the user key.
sourceType
is 'content', then specify the content ID.sourceType
is 'space', then specify the space key.string
The status of the source. This parameter is only used when the
sourceType
is 'content'.
string
The status of the target. This parameter is only used when the
targetType
is 'content'.
integer
The version of the source. This parameter is only used when the
sourceType
is 'content' and the sourceStatus
is 'historical'.
int32
integer
The version of the target. This parameter is only used when the
targetType
is 'content' and the targetStatus
is 'historical'.
int32
1 2
curl --request DELETE \
--url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}'
Returned if the relationship is deleted or the relationship didn't exist.
GET /wiki/rest/api/relation/{relationName}/to/{targetType}/{targetKey}/from/{sourceType}
Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
For example, the following method finds all users that have a 'collaborator'
relationship to a piece of content with an ID of '1234':
GET https://your-domain.atlassian.net/wiki/rest/api/relation/collaborator/to/content/1234/from/user
Note, 'collaborator' is an example custom relationship type.
Permissions required: Permission to view both the target entity and source entity.
App scope required: READ
read:confluence-content.summary
string
The name of the relationship. This method supports relationships created via Create relationship. Note, this method does not support 'favourite' relationships.
string
The source entity type of the relationship.
Valid values: user
, content
, space
string
The target entity type of the relationship.
Valid values: user
, content
, space
string
The identifier for the target entity:
targetType
is user
, then specify either current
(logged-in user), the user key of the user, or
the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the
migration guide
for details.targetType
is 'content', then specify the content ID.targetType
is 'space', then specify the space key.string
The status of the source. This parameter is only used when the
sourceType
is 'content'.
string
The status of the target. This parameter is only used when the
targetType
is 'content'.
integer
The version of the source. This parameter is only used when the
sourceType
is 'content' and the sourceStatus
is 'historical'.
int32
integer
The version of the target. This parameter is only used when the
targetType
is 'content' and the targetStatus
is 'historical'.
int32
Array<string>
A multi-value parameter indicating which properties of the response object to expand.
relationData
returns information about the relationship, such as
who created it and when it was created.source
returns the source entity.target
returns the target entity.form
Valid values: relationData
, source
, target
integer
The starting index of the returned relationships.
0
, Minimum: 0
, Format: int32
integer
The maximum number of relationships to return per page. Note, this may be restricted by fixed system limits.
25
, Minimum: 0
, Format: int32
1 2 3
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/relation/{relationName}/to/{targetType}/{targetKey}/from/{sourceType}' \
--header 'Accept: application/json'
Returned if the requested relationships are returned.
Content type | Value |
---|---|
application/json |
Rate this page: