Backend resource · STATIC DECLARATIONS
Organization API reference · mansoq-core-teleicu
Static source contract for Organization: 10 declared or inherited operation mappings, schema/field evidence and authorization/refusal references. Deployment and behavioral review remain explicit.
Static API contract — behavior review pending. Source baseline f6e9f05f76d4.
Enable JavaScript to inspect structured operation, parameter, schema and permission evidence. Download this reference and its evidence.
Declared route and availability
This resource is declared in mansoq-core-teleicu at /api/v1/organization/. verified core mount in config/urls.py This is an alternative core contract, not proof that the primary core uses the same behavior. A registered path and an indexed handler do not prove deployment availability, user permission or production readiness.
Operation map
| Method | Path | Action | Evidence |
|---|---|---|---|
| GET | /api/v1/organization/ |
list | declared/inherited method |
| POST | /api/v1/organization/ |
create | declared/inherited method |
| GET | /api/v1/organization/{external_id}/ |
retrieve | declared/inherited method |
| PUT | /api/v1/organization/{external_id}/ |
update | declared/inherited method |
| PATCH | /api/v1/organization/{external_id}/ |
partial_update | declared/inherited method |
| DELETE | /api/v1/organization/{external_id}/ |
destroy | declared/inherited method |
| POST | /api/v1/organization/upsert/ |
upsert | @action declaration |
| GET | /api/v1/organization/mine/ |
mine | @action declaration |
| GET | /api/v1/organization/accessible_role_organizations/ |
accessible_role_organizations | @action declaration |
| POST | /api/v1/organization/{external_id}/managing_organization/ |
managing_organization | @action declaration |
list · GET
GET /api/v1/organization/ — action list. static contract extracted; runtime/permission/payload behavior review pending.
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
response: OrganizationReadSpec. Declared fields below; inherited fields are retained in the schema inventory.
| Field | Type | Required | Constraints |
|---|---|---|---|
| meta | dict | false | No extra constraint extracted |
| id | str | false | No extra constraint extracted |
| active | bool | false | No extra constraint extracted |
| org_type | OrganizationTypeChoices | true | No extra constraint extracted |
| name | str | true | No extra constraint extracted |
| description | str | false | No extra constraint extracted |
| metadata | dict | false | No extra constraint extracted |
| level_cache | int | false | No extra constraint extracted |
| system_generated | bool | true | No extra constraint extracted |
| has_children | bool | true | No extra constraint extracted |
| parent | dict | true | No extra constraint extracted |
Observed authorization checks: get_accessible_organizations. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
create · POST
POST /api/v1/organization/ — action create. static contract extracted; runtime/permission/payload behavior review pending.
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
| body | form_submission |
not declared at read site | not established |
request: OrganizationWriteSpec. Declared fields below; inherited fields are retained in the schema inventory.
| Field | Type | Required | Constraints |
|---|---|---|---|
| meta | dict | false | No extra constraint extracted |
| id | str | false | No extra constraint extracted |
| active | bool | false | No extra constraint extracted |
| org_type | OrganizationTypeChoices | true | No extra constraint extracted |
| name | str | true | No extra constraint extracted |
| description | str | false | No extra constraint extracted |
| metadata | dict | false | No extra constraint extracted |
| parent | UUID4 | None | false | No extra constraint extracted |
response: OrganizationRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.
| Field | Type | Required | Constraints |
|---|---|---|---|
| meta | dict | false | No extra constraint extracted |
| id | str | false | No extra constraint extracted |
| active | bool | false | No extra constraint extracted |
| org_type | OrganizationTypeChoices | true | No extra constraint extracted |
| name | str | true | No extra constraint extracted |
| description | str | false | No extra constraint extracted |
| metadata | dict | false | No extra constraint extracted |
| level_cache | int | false | No extra constraint extracted |
| system_generated | bool | true | No extra constraint extracted |
| has_children | bool | true | No extra constraint extracted |
| parent | dict | true | No extra constraint extracted |
| permissions | list[str] | false | No extra constraint extracted |
| managing_organizations | list[dict] | false | No extra constraint extracted |
Observed authorization checks: get_accessible_organizations, can_create_organization_obj. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Declared refusal/error evidence: PermissionDenied: Root Organizations can only be created by the superadmin; PermissionDenied: Organization Type cannot be created; ValidationError: Cannot create organizations under role organizations; PermissionDenied: User does not have the required permissions to create organizations; ValidationError: Organization already exists with same name; ValidationError (dynamic detail; inspect source).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration; parent.level_cache comparison settings.ORGANIZATION_MAX_DEPTH.
retrieve · GET
GET /api/v1/organization/{external_id}/ — action retrieve. static contract extracted; runtime/permission/payload behavior review pending.
Path and deployment-context parameters:
| Location | Parameter | Type | Required |
|---|---|---|---|
| path | external_id | router lookup string; semantic ID validation requires handler/schema review | true |
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
response: OrganizationRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.
The declared field table is shown at its first occurrence in this reference; this operation links the same schema.
Observed authorization checks: get_accessible_organizations. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
update · PUT
PUT /api/v1/organization/{external_id}/ — action update. static contract extracted; runtime/permission/payload behavior review pending.
Path and deployment-context parameters:
| Location | Parameter | Type | Required |
|---|---|---|---|
| path | external_id | router lookup string; semantic ID validation requires handler/schema review | true |
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
request: OrganizationUpdateSpec. Declared fields below; inherited fields are retained in the schema inventory.
| Field | Type | Required | Constraints |
|---|---|---|---|
| meta | dict | false | No extra constraint extracted |
| id | str | false | No extra constraint extracted |
| active | bool | false | No extra constraint extracted |
| org_type | OrganizationTypeChoices | true | No extra constraint extracted |
| name | str | true | No extra constraint extracted |
| description | str | false | No extra constraint extracted |
| metadata | dict | false | No extra constraint extracted |
response: OrganizationRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.
The declared field table is shown at its first occurrence in this reference; this operation links the same schema.
Observed authorization checks: get_accessible_organizations, can_manage_organization_obj. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Declared refusal/error evidence: PermissionDenied: Organization Type cannot be updated; PermissionDenied: User does not have the required permissions to update organizations; ValidationError: Organization already exists with same name; ValidationError (dynamic detail; inspect source).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration; parent.level_cache comparison settings.ORGANIZATION_MAX_DEPTH.
partial_update · PATCH
PATCH /api/v1/organization/{external_id}/ — action partial_update. static contract extracted; runtime/permission/payload behavior review pending.
Path and deployment-context parameters:
| Location | Parameter | Type | Required |
|---|---|---|---|
| path | external_id | router lookup string; semantic ID validation requires handler/schema review | true |
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
request: OrganizationUpdateSpec. Declared fields below; inherited fields are retained in the schema inventory.
The declared field table is shown at its first occurrence in this reference; this operation links the same schema.
response: OrganizationRetrieveSpec. Declared fields below; inherited fields are retained in the schema inventory.
The declared field table is shown at its first occurrence in this reference; this operation links the same schema.
Observed authorization checks: get_accessible_organizations, can_manage_organization_obj. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Declared refusal/error evidence: ValidationError: Organization already exists with same name; ValidationError (dynamic detail; inspect source); PermissionDenied: Organization Type cannot be updated; PermissionDenied: User does not have the required permissions to update organizations.
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration; parent.level_cache comparison settings.ORGANIZATION_MAX_DEPTH.
destroy · DELETE
DELETE /api/v1/organization/{external_id}/ — action destroy. static contract extracted; runtime/permission/payload behavior review pending.
Path and deployment-context parameters:
| Location | Parameter | Type | Required |
|---|---|---|---|
| path | external_id | router lookup string; semantic ID validation requires handler/schema review | true |
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
Observed authorization checks: get_accessible_organizations, can_manage_organization_obj. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Explicit response statuses in observed code: status.HTTP_204_NO_CONTENT. Other branches/framework exception handling may differ.
Declared refusal/error evidence: PermissionDenied: Cannot delete organization with children; PermissionDenied: Organization Type cannot be deleted; PermissionDenied: User does not have the required permissions to delete organizations.
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
upsert · POST
POST /api/v1/organization/upsert/ — action upsert. static contract extracted; runtime/permission/payload behavior review pending.
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| body | datapoints |
not declared at read site | not established |
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
| body | form_submission |
not declared at read site | not established |
Observed authorization checks: get_accessible_organizations, can_manage_organization_obj, can_create_organization_obj. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Explicit response statuses in observed code: 400. Other branches/framework exception handling may differ.
Declared refusal/error evidence: RestFrameworkValidationError: Invalid request data; RestFrameworkValidationError: No datapoints provided; RestFrameworkValidationError: Too many datapoints provided; ValidationError: Organization already exists with same name; ValidationError (dynamic detail; inspect source); PermissionDenied: Organization Type cannot be updated; PermissionDenied: User does not have the required permissions to update organizations; PermissionDenied: Root Organizations can only be created by the superadmin; PermissionDenied: Organization Type cannot be created; ValidationError: Cannot create organizations under role organizations; PermissionDenied: User does not have the required permissions to create organizations.
Conditional gates: conditional/computed expression; inspect pinned declaration comparison settings.MAX_DATAPOINTS_PER_UPSERT; permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration; parent.level_cache comparison settings.ORGANIZATION_MAX_DEPTH.
mine · GET
Get organizations that are directly attached to the given user
GET /api/v1/organization/mine/ — action mine. static contract extracted; runtime/permission/payload behavior review pending.
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
Observed authorization checks: get_accessible_organizations. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
accessible_role_organizations · GET
GET /api/v1/organization/accessible_role_organizations/ — action accessible_role_organizations. static contract extracted; runtime/permission/payload behavior review pending.
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
Observed authorization checks: get_accessible_organizations. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
managing_organization · POST
POST /api/v1/organization/{external_id}/managing_organization/ — action managing_organization. static contract extracted; runtime/permission/payload behavior review pending.
Path and deployment-context parameters:
| Location | Parameter | Type | Required |
|---|---|---|---|
| path | external_id | router lookup string; semantic ID validation requires handler/schema review | true |
Directly observed request reads (these do not constitute a complete accepted-payload or requiredness guarantee):
| Location | Field | Declared/inferred read type | Requiredness evidence |
|---|---|---|---|
| query | parent |
not declared at read site | not established |
| query | permission |
not declared at read site | not established |
decorator request: OrganizationManagingOrganizationRequest. Declared fields below; inherited fields are retained in the schema inventory.
| Field | Type | Required | Constraints |
|---|---|---|---|
| organization | UUID4 | true | No extra constraint extracted |
| action | OrganizationManagingOrganizationAction | true | No extra constraint extracted |
Observed authorization checks: can_manage_organization_obj, get_accessible_organizations. Helper/queryset evidence is included; this is not proof of complete security review.
Class policy declarations: authentication_classes: JWTTokenPatientAuthentication, computed annotation (review required).
Declared refusal/error evidence: ValidationError: Managing organization is only supported for role organizations; PermissionDenied: User does not have the required permissions to requested organization; PermissionDenied: User does not have the required permissions to manage the organization; ValidationError: Managing organization is not part of the organization.
Conditional gates: permission in self.request.GET and not self.request.user.is_superuser or not conditional/computed expression; inspect pinned declaration.
Integration review checklist
Confirm the installed route and full schema; review authentication, organization/facility scoping, all accepted fields, value-state and date/time semantics, idempotency, pagination, response/exception branches and the allowed correction/reversal workflow. Test positive and negative cases with synthetic data. This source reference does not establish external certification or replace an illustrated user procedure.
Pinned source evidence
Links require access to the private source repository.
- repositories/teleicu/mansoq-core-teleicu/config/api_router.py:185
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:82
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:165
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:205
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:158
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:327
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:155
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/resources/organization/spec.py:53
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:133
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:157
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:139
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:127
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:103
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:95
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:136
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:322
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:349
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:346
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:92
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/resources/organization/spec.py:32
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/resources/organization/spec.py:65
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:80
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:77
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:74
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:211
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:140
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:225
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:198
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:332
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:177
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:219
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/resources/organization/spec.py:28
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:215
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:258
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:120
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:255
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:189
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/base.py:268
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:250
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:264
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:317
- repositories/teleicu/mansoq-core-teleicu/mansoq/emr/api/viewsets/organization.py:77