AI Agent service REST API - "Project not found"

JacksonAlvarez-5176 70 Reputation points
2025-05-22T17:12:25.76+00:00

Note - I put this under Azure AI Bot Service tag because there's not yet an Azure AI Agent Service tag.

Currently, I have a React Native app that needs to interact with a preexisting agent in my Foundry project. I cannot use the Azure Javascript SDK for this, because that SDK is incompatible with React Native (and Microsoft has no plans to make it so). Instead, I'm hitting the REST API that Foundry provides, to moderate success.

Are there still no docs for the AI Agent rest api? I've looked everywhere for this and all the information is limited and scattered.

Any rest api call I make in my app results in a "Project not Found" 404 error. I've tried several different ideas for what my project name might be, but I'm almost positive that the correct name is returning this error.

Here's the code I'm using to call the api.

const ENDPOINT: string = "https://[REDACTED].services.ai.azure.com/api/projects/aiagentserviceproject"; // overview -> azure ai inference -> change end of path from /models to /api/projects/project name (top right of screen)
const API_VERSION: string = "2025-05-15-preview";
const azureApiCall = async <ReturnType = undefined, BodyType = undefined>(opts: {desc: string, urlSegment: string, reqBody?: BodyType, httpMethod?: 'GET' | 'POST'}): Promise<ReturnType | undefined> => {
    const {desc, urlSegment, reqBody, httpMethod} = {httpMethod: 'POST', ...opts};

    try {
        const url: string = `${ENDPOINT}/${urlSegment}?api-version=${API_VERSION}`;
		// urlSegment in this case is just "assistants" for list agents call    

        console.log(`Executing "${desc}" at url: ${url}`);

        const request: RequestInit = {
            method: httpMethod,
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${API_KEY}`,
            },
        }

        if (reqBody) {
            request.body = JSON.stringify(reqBody);
        }
    
        const response: Response = await fetch(url, request);

        console.log(`Executed "${desc}" with status: ${response.status}, msg: ${response.statusText || 'No included message'}`);

        const data = await response.json();
        
        console.log(`Resulting data of "${desc}", ${JSON.stringify(data, null, 2)}`);

        if (response.status === 200) {
            return data as ReturnType;
        }        
    } catch (e) {
        console.log(`Error executing "${desc}": ${JSON.stringify(e, null, 2)}`);
    }
}

and this is the output of that call

Resulting data of "List Agents", {

"error": {

"code": "NotFound",

"message": "Project not found"
```  }

}

I've verified that I have all the necessary permissions, so I'm at a loss. The project name you see in the code above, "aiagentserviceproject" can be found at the top right of the foundry dashboard, and I'm almost positive that this is the correct project name

![User's image](/api/attachments/0bd4d259-8f64-4d4d-9304-b25d64e2eddb?platform=QnA)

Additionally, changing the project name to a random string of characters causes the same error. So I know that it is the project name that is at fault.

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,598 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Azar 29,520 Reputation points MVP Volunteer Moderator
    2025-05-22T21:13:28.71+00:00

    Hi there JacksonAlvarez-5176

    Thanks for using QandA platform

    Since public docs for AI Agent REST APIs are still limited, your best bet is:

    Use the project ID (not name) from the Foundry dashboard's API tab or inspect the network requests in the browser dev tools.

    check the base endpoint and API version match the ones listed in the Foundry UI for your project.

    If you're still stuck, you may need to raise a support ticket, as the REST API surface is still evolving and not well-documented yet.

    If this helps kindly accept the answer thanks much.


  2. Roberto Lambertini 80 Reputation points
    2025-06-05T15:56:50.0266667+00:00

    Hello,

    I have the same problem.
    When calling either with curl, or using AI Foundry SDK in a c# console application the result is always a "project not found"

    for example

    curl --request GET `
    --url https://[redacted].services.ai.azure.com/api/projects/[redacted]/assistants?api-version=2025-05-01 `
    -H "Authorization: Bearer $token" `
    -H "Content-Type: application/json"
    

    returns

    {"error":{"code":"NotFound","message":"Project not found"}}
    

    Thanks in advance


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.