Hi everyone, I am trying not to ask very basic que...
# ory-network
d
Hi everyone, I am trying not to ask very basic questions here, but I did not find anything in slack or GitHub discussions referring this is a problem. I'd like to delete a project I've created for testing only purposes in Ory cloud and I found this in the docs: https://www.ory.sh/docs/reference/api#operation/getProject https://www.ory.sh/docs/reference/api#operation/purgeProject reading that I end up with:
Copy code
$ ory list projects
You are authenticated as: *******
ID					SLUG				STATE	NAME
e83f2025-99da-41a1-8308-adacfbaaf957	tender-shockley-zddpqno1ny	running	project-name-here

$ curl --location --request GET '<https://tender-shockley-zddpqno1ny.projects.oryapis.com/projects/e83f2025-99da-41a1-8308-adacfbaaf957>' --header 'Authorization: Bearer ory_pat_*********'
{"error":{"code":404,"status":"Not Found","request":"dda4700f-a053-968c-8c6f-493039723549","message":"Requested url does not match any rules"}}

$ curl --location --request DELETE '<https://tender-shockley-zddpqno1ny.projects.oryapis.com/projects/e83f2025-99da-41a1-8308-adacfbaaf957>' --header 'Authorization: Bearer ory_pat_*********''
{"error":{"code":404,"status":"Not Found","request":"de0cdcf9-a577-9af5-861f-668f2921543f","message":"Requested url does not match any rules"}}
Am I doing something wrong here? The PAT I've checked with querying the
admin/identities
endpoint and it works. Thanks in advance!
p
I believe the URL is not the project but the Ory cloud backend -https://api.console.ory.sh and you might need to use a session cookie instead of the PAT
I can quickly check
Yeah I can confirm it works with the session cookie
so the cURL would be To List
Copy code
curl <https://api.console.ory.sh/projects/><project-id> -H "Accept: application/json" --cookie "<your cookies>"
To Delete
Copy code
curl -X DELETE <https://api.console.ory.sh/projects/><project-id> -H "Accept: application/json" --cookie "<your cookies>"
the cookies you can get from your browser. Sign into the Ory console and copy it from the dev tools.
We still need to add this functionality into the Ory CLI - I will quickly create an issue for that
d
Thanks a million Alano 💪
❤️ 1
@proud-plumber-24205 I tried now and I got this error:
Copy code
{
  "error": {
    "code": 500,
    "status": "Internal Server Error",
    "request": "6caaf7b8-1a72-9cf0-b0ab-f9d537487516",
    "message": "ERROR: delete on table \"ory_keto_networks\" violates foreign key constraint \"keto_relation_tuples_nid_fk\" on table \"keto_relation_tuples\" (SQLSTATE 23503)"
  }
}
p
Strange, I was able to delete my project. Maybe the project is already deleted?
@dazzling-lock-68691 are you sure the project isn't already deleted?
d
@proud-plumber-24205 the project is still there. I see it in the web UI and using the CLI
p
That's odd. I think let's create an issue about this
I think in the meantime we can help you manually delete it @narrow-van-43826 @famous-art-85498
d
Thank you @proud-plumber-24205 🙂