# Access to Incoming Links via REST API?

**URL:** <https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507>\
**Category:** Confluence Cloud\
**Tags:** confluence-cloud\
**Created:** [May 27, 2019, 2:49am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507 "2019-05-27T02:49:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgriffo](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tgriffo](https://community.developer.atlassian.com/u/tgriffo)\
**Post date:** [May 27, 2019, 2:49am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/1 "2019-05-27T02:49:24Z")

</div>

Hi folks,

when you navigate to a page in Confluence and view its information (i.e. click on the three dots and then on “Page Information”) you can see which other pages/content link to it, called “Incoming Links”.

Is this info something that is also available via the REST APIs? I’ve over the Content APIs and have been playing around with them but can’t seem to find that field anywhere, including expand fields.

Am I missing something?

Thank you.

---

<div class="post-metadata">

**Author:** ![acalantog](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/acalantog/32/37988_2.png) [@acalantog](https://community.developer.atlassian.com/u/acalantog)\
**Post date:** [May 28, 2019, 6:41am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/2 "2019-05-28T06:41:16Z")

</div>

Hi @tgriffo,

Welcome to the community!

AFAIK, there’s no way to get these information through the REST API. I tried expanding several fields but wasn’t able to get the information.

Cheers,  
Anne

---

<div class="post-metadata">

**Author:** ![tgriffo](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tgriffo](https://community.developer.atlassian.com/u/tgriffo)\
**Post date:** [May 28, 2019, 10:59am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/3 "2019-05-28T10:59:01Z")

</div>

Hi Anne,

Same as my findings.

Thanks very much for giving it a try, I appreciate it! And thanks for the welcome, I’m happy to be here.

Cheers,  
Tiago

---

<div class="post-metadata">

**Author:** ![acalantog](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/acalantog/32/37988_2.png) [@acalantog](https://community.developer.atlassian.com/u/acalantog)\
**Post date:** [May 29, 2019, 6:28am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/4 "2019-05-29T06:28:33Z")

</div>

Hi @tgriffo,

No worries! Glad to help. I’ll just mark the answer as solved so other developers may find it helpful.

Cheers,  
Anne

---

<div class="post-metadata">

**Author:** ![lassenza](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lassenza](https://community.developer.atlassian.com/u/lassenza)\
**Post date:** [November 4, 2022, 2:33pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/5 "2022-11-04T14:33:02Z")

</div>

You can get incoming and outgoing links of a page using the _ **Relation** _ REST API [https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-relation/](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-relation/)

---

<div class="post-metadata">

**Author:** ![PatrickHilgarth](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@PatrickHilgarth](https://community.developer.atlassian.com/u/PatrickHilgarth)\
**Post date:** [November 10, 2022, 11:38am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/6 "2022-11-10T11:38:53Z")

</div>

Hi lassenza,

thanks for that link, it pushed me in the right direction. I’m just missing a little piece of information now 😉

The API endpoint looks like that:

`/wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}`

So I think I would do

`...relation/{relationName}/from/content/123456/to/content/45678`

But I have no idea, what relationName to use. Do I have to create the relationship manually? I would guess it’s created automatically when linking the pages…

Thanks in advance 😉

---

<div class="post-metadata">

**Author:** ![lassenza](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lassenza](https://community.developer.atlassian.com/u/lassenza)\
**Post date:** [November 10, 2022, 12:24pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/7 "2022-11-10T12:24:01Z")

</div>

Hi @PatrickHilgarth, yeah the documentation is not particularly clear.  
The `relationName` should be `link`.

So, for example, to get incoming links to page 123456 the endpoint would be:  
`wiki/rest/api/relation/link/to/content/123456/from/content?expand=source`

Instead, for outgoing links from the same page the endpoint would be:  
`wiki/rest/api/relation/link/from/content/123456/to/content?expand=target`

---

<div class="post-metadata">

**Author:** ![PatrickHilgarth](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@PatrickHilgarth](https://community.developer.atlassian.com/u/PatrickHilgarth)\
**Post date:** [November 10, 2022, 12:42pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/8 "2022-11-10T12:42:19Z")

</div>

Hi @lassenza - unfortunately this does not work, my url looks like that:

`http://localhost:1990/confluence/wiki/rest/api/relation/link/to/content/950276/from/content?expand=source`

Any more ideas? I fear, that it’s simply not possible to fetch this data via the API…

I get an 404, when trying it:

![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/4/5/458f1704e4d05f8f137e903306a52e90e323c7e7.png)

---

<div class="post-metadata">

**Author:** ![lassenza](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lassenza](https://community.developer.atlassian.com/u/lassenza)\
**Post date:** [November 10, 2022, 2:43pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/9 "2022-11-10T14:43:56Z")

</div>

So you are using server. I thought you were using cloud.  
For server I don’t think there is any REST API for getting incoming/outgoing links.  
But you can use the Confluence API.

For example for retrieving incoming links you could use [LinkManager](https://docs.atlassian.com/ConfluenceServer/javadoc/7.1.0/com/atlassian/confluence/links/LinkManager.html).

For outgoing links you could use [OutgoingLinksExtractor](https://docs.atlassian.com/ConfluenceServer/javadoc/7.1.0/com/atlassian/confluence/content/render/xhtml/links/OutgoingLinksExtractor.html)

---

<div class="post-metadata">

**Author:** ![PatrickHilgarth](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@PatrickHilgarth](https://community.developer.atlassian.com/u/PatrickHilgarth)\
**Post date:** [November 11, 2022, 7:20am UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/10 "2022-11-11T07:20:34Z")

</div>

I still were on my local environment, where I got the 404.

On our cloud platform however, I get a result. Unfortunately, it’s just an empty array. Am I missing something here? See my code and the output in the forge tunnel:

 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/0/9/09572d903fc70fb9bc467ad7ee9e31932fb8934e.png)

---

<div class="post-metadata">

**Author:** ![lassenza](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lassenza](https://community.developer.atlassian.com/u/lassenza)\
**Post date:** [November 14, 2022, 3:15pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/11 "2022-11-14T15:15:31Z")

</div>

Have you tried `/rest/api/relation/link/to/content/${contentId}/from/content?expand=source` instead of `/wiki/rest/api/relation/link/to/content/${contentId}/from/content?expand=source` ?

---

<div class="post-metadata">

**Author:** ![MatteoGubelliniSoftC](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/matteogubellinisoftc/32/42326_2.png) [@MatteoGubelliniSoftC](https://community.developer.atlassian.com/u/MatteoGubelliniSoftC)\
**Post date:** [January 10, 2023, 5:08pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/12 "2023-01-10T17:08:16Z")

</div>

Hi,  
Did anyone manage to get some results?  
I too get an empty array.  
Thanks

---

<div class="post-metadata">

**Author:** ![BertDombrecht](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@BertDombrecht](https://community.developer.atlassian.com/u/BertDombrecht)\
**Post date:** [April 24, 2023, 2:06pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/13 "2023-04-24T14:06:27Z")

</div>

I’m looking for a solution to this as well.  
I too get an empty array:  
 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/c/e/ce60e693b9d1d5310e1de1ea7d902eb0c8695df9.png)

---

<div class="post-metadata">

**Author:** ![AlexanderMartin](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@AlexanderMartin](https://community.developer.atlassian.com/u/AlexanderMartin)\
**Post date:** [June 28, 2023, 1:47pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/14 "2023-06-28T13:47:40Z")

</div>

Hi,  
Same here, as result I get an empty array only.  
Has anyone managed to find out the backlinks?

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [June 28, 2023, 3:59pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/15 "2023-06-28T15:59:26Z")

</div>

@AlexanderMartin @BertDombrecht @MatteoGubelliniSoftC @PatrickHilgarth,

Please open a new topic. This question was initially asked in #Confluence Cloud with some people later asking about #Confluence Server. The products are quite different in their REST APIs, if not internal workings. So, with this topic having been “solved”, we need a new question in the category appropriate to your problem. Otherwise, I fear this topic won’t get any new answers.

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [June 28, 2023, 3:59pm UTC](https://community.developer.atlassian.com/t/access-to-incoming-links-via-rest-api/29507/16 "2023-06-28T15:59:30Z")

</div>


